| | |
What am I doing wrong?
![]() |
•
•
Join Date: Oct 2005
Posts: 27
Reputation:
Solved Threads: 0
My darn code keeps crashing, what am I doing wrong? I have a class with the follwoing method:
I'm calling the method like this:
sockBuffer was declared like ...
Now, when I run the program and it calls AddToBuffer it crashes with a Bus error.
How am I calling this method wrong?
I'm using XCode 2.0
Thanks!
C Syntax (Toggle Plain Text)
void BBSNode::AddToBuffer(char *buffer) { //strcat((char*)inputBuffer, (char*)buffer); sprintf("Got Data: %s\n", buffer); }
I'm calling the method like this:
C Syntax (Toggle Plain Text)
nodes[nodeID].AddToBuffer(sockBuffer);
sockBuffer was declared like ...
C Syntax (Toggle Plain Text)
char sockBuffer[IN_BUFFER_SIZE];
Now, when I run the program and it calls AddToBuffer it crashes with a Bus error.
How am I calling this method wrong?
I'm using XCode 2.0
Thanks!
•
•
•
•
sprintf("Got Data: %s\n", buffer);
•
•
•
•
sprintf(InputBuffer, "Got Data: %s\n", buffer);
C Syntax (Toggle Plain Text)
strcpy(InputBuffer,"Got Data: "); strcat(InputBuffer,buffer);
![]() |
Similar Threads
- My CD-RW plays but won't burn. What could be wrong?? Help Please? (Storage)
- Retrieve email I sent to the wrong person (Web Browsers)
- Ram voltage wrong?? (Motherboards, CPUs and RAM)
- Am I going about this the wrong way (IT Professionals' Lounge)
- wats wrong with imesh??? (Windows NT / 2000 / XP)
Other Threads in the C Forum
- Previous Thread: Type casting and type conversions
- Next Thread: help me on this power of 2
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






Thanks for your views everyone.
