I'm having a small problem with debugging my application in VS C++.
When I pass in a single parameter, the debugger insists 2 parameters have been passed in.
The first parameter is invariably "d" and the second parameter is always the first character of whatever I pass in.

Further, if I run the program from the command line, I get the same problem except that the first parameter is always "s".

Does anyone have any idea what could be causing this? I suspect that maybe its a setting somewhere in VS, but it has me stumped.
Thanks

Do the parameters print ok when coded like this ? I am assuming you are NOT compiling for UNICODE because if you were you would be getting other problems.

#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    for(int i = 0; i < argc; i++)
        cout << argv[i] << "\n";
	return 0;
}

Ah, I was using a "char* argv[]" in my main function declaration.
Thanks!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.