[EMAIL PROTECTED] writes:

> I have written a program (my first big program in c++). When I run the
> program it gives segmentation fault but when i use a printf statement
> to debug the program, it runs normally.

Lesson 1: don't use printf() to debug programs.

> I am very confused that what may be the reason?

The reason is that adding printf()s changes the program layout in
memory, and may hide (or expose) bugs.

> Any Ideas?

Learn and use 'gdb'.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to