Hello. This is my first post here. Thanks for your help.
I have been coding a program which handles many arrays of strings. The program sometimes (there is a random number generator in the codes) will crash with a message "bus error".
I am guessing it's caused by those strings. I tried to find out where exactly the error occurs by adding print lines inbetween coding blocks like the following:
100 printf("100\n");
codes...
200 printf("200\n");
codes...
300 printf("300\n");
However, it didn't help because the output will be something like
100
200
300
100
20
which means it crashes in the middle of printing 200?
Anyway, because i can't exactly pin down which part of the code causes the problem, it is very hard for me to fix it.
Any ideas?
Thanks a lot.