views:

13

answers:

0

Hi,

I have been working on a uni C++ project. I am presently using VS2010 . It is almost the end and now I am facing a strange problem.

I try to run my program in debug mode by pressing F5. It works fine. Then I try to run the program by pressing Ctrl + F5, and I get an exception at free.c (It gives an exception to vector.push_back).

Then, I try the release mode. I try to run the program from the cmd. Yesterday I remember it was giving an error even before reaching that part. Today it just happens to work completely well (even though the Ctrl + F5 problem is still there).

I tried to search and the most common problem seems to be uninitialized local variables. So I went to my solution file and turned up the warning level to 4 for each of my projects and I do not seem to have any uninitialized variable before the part where the ctrl + F5 gives problem. Is there a better way to check if there is no uninitialized variable (without actually having to go through the entire code? )

Could there be any other problems? I also found that it maybe because of uninitialized memory locations. From what I know, the code is using pointers only when it comes to class objects. Otherwise we stick to stack memory and we pass by reference always (except when we are passing the class object).

Thanks for your reply.

Regards, Harsha