1) Learn to use the 'reply' button, there is no need for a new tread for each comment you have.
2) Learn to use a debugger such as gdb, actually, i would recommend ddd or any other GUI front end to gdb.
3) Learn to use valgrind, i don't know of any GUI for it, but its simple enough to learn the CLI.
3) Learn what information to post. Posting all your source code without even saying where the error occurs will not get you any help. Only post what is needed, and only after you run it thru a debugger to find the problem yourself.