[prog] Segmentation fault :-(
Sujita Purushothaman
sujita at mimos.my
Tue Sep 24 14:31:17 EST 2002
Jacinta Richardson wrote:
> > I'm trying to debug a C++ program (not written by me).
> > This program gives a segmentation fault at the line :
>
> > temp = BaseSocket::Receive(unsigned char *a,int b, int c);
>
> It's been about 3 years since I've really touched C or C++ but try
> changing this to:
>
> temp = BaseSocket::Receive(a, b, c);
>
That's actually how the line is, I added the types so people would
know what type a,b & c are. Dumb me. Didn't see that it would make
no sense to a person reading :-(
> or
> temp = BASESocket::Receive(&a, b, c);
> whichever is correct for the type of a.
> As far as I remember, passing type casts into a function was always a
> surefire way to end up with headaches.
>
> Oh, and hi everyone, I'm a Perl programmer by trade. ;)
I am going to start learning Perl in a few weeks,I think I'll be having
some
free time then. Why Perl? Dunno, everyone seems to know Perl, and I
don't. :-) Besides, I always like learning new languages, computer
or otherwise :-)
Rgds,
Sujita
More information about the Programming
mailing list