I am using Visual C ++ with the following code:
int _tmain(int argc, _TCHAR* argv[])
{
for (int i = 0; i < argc; ++i)
{
cout << argv[i] << endl;
}
getch();
return 0;
}
A program with a name MyProgram.exe.
Then I run the program: MyProgram.exe hello world
The program should have printed:
MyProgram.exe
hello
world
but he didn’t, he printed 3 lines of address values:
005D1170
005D118C
005D1198
Did I do something wrong?
source
share