I keep getting wrong values in VS2012 from command arguments while in debug mode. I've set the right arguments through Properties->Configuration properties->Debugging->Command Arguments, but I still get the same wrong output.
The code works in release mode, but not in debug mode.
Here is my code:
int main(int argc, char **argv)
{
cout << argc << endl;
return 0;
}
Output is: 2130567168
Also, I've checked memory block where argv should be pointing at and it has nothing relevant to my passed arguments.
EDIT:
I've fixed the problem thanks to doctorlove's questioning. Apparently, setting the Entry Point produced the wrong value. I've had set it to "main" and removing it fixed the problem.
Can anyone explain why this happend?