I've been struggling with seg faults the entire time I've been developing my program, but I've been able to overcome until recently.
I won't post the entire program (unless requested) since its ~600 lines long and uses some application-specific API functions, but hopefully some direction will get me straightened out.
Q: is the following code snippet valid?
I'm asking to make sure that putting the '\0' at the end will end the string appropriately when being passed to the function.Code:void WriteToLogfile(char message[50]); ... .. . WriteToLogfile("this is a sample string\n\0");
Currently, my program compiles and runs *almost* successfully. It performs everything that is asked of it. My debug logging shows that it finishes all of its routines successfully, but it still cores (seg faults) at the very end when run. What is strange to me is that after the last successful operation it only returns and exits. Any assistance with understanding this behavior and more importantly its potential causes would be greatly appreciated.
I haven't programmed C in over 10 yrs. (if you even consider my college "traveling salesman" algorithms to be programs) so please be gentle!