Reputation: 2186
I've built really simple win32 console program using the Microsoft Visual Studio 2012 Ultimate IDE in C++;
This is the code:
int _tmain(int argc, _TCHAR* argv[])
{
int i = 0;
i++;
return = 0
}
Debugging through the code line by line, I noticed this:
In Debug x64 mode, argc = 1
, argv[0] = the program's path
In Release x64 mode, argc = some random large number
, argv[0] = some random path or simply 0x00000001
Why is this?
Any help would be appreciated.
Upvotes: 0
Views: 259
Reputation: 7271
The default build options for release mode will not give you sensible debugging in release mode. The optimizations the compiler uses in release mode means that the compiled code can look quite different (but be logically the same) as what you have written.
There's already a good answer to this, see How to debug in release mode?
Upvotes: 5