| | |
What am I doing wrong?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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 ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






Thanks for your views everyone.
