Possible Duplicate:
Can not print out the argv[] values using std::cout in VC++
Code:
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << argv[0] << endl;
system("PAUSE");
return 0;
}
As you can see, a standard Win32 console application.
The confusing part is, the value of argv[0]
is output as 00035B88
.
This is being (AFAIK) run with no command-line options so argv[]
should not have a value yet. (or is this the problem?)
However, argv[]
is declared as a pointer (_TCHAR*
) and I heard that cout
will print the address of pointers. Is this the case? If so, how can I print/use the value of argv
?