Possible Duplicate:
What is the difference between _tmain() and main() in C++?
I have a console application, which takes one command line parameter.
int _tmain(int argc, char* argv[])
{
...
printf("Path: %s\n", argv[1]);
...
}
When I run the program with an argument (myprogram.exe D:\myfolder\myfile
), it prints Path: D
instead of Path: D:\myfolder\myfile
.
How should I change the procedure for extracting first command-line parameter (argv[1]
) so that it returns the full path, not just the first letter?
I tried to put the path in quotes (myprogram.exe "D:\myfolder\myfile"
), but it didn't help.