Reputation: 21
command line arguments having null after each char suppose i call the program from the command prompt like "abc.exe test data" then in memory there is an space after each char and the data is "t.e.s.t..d.a.t.a" What is the issue. It is printing t only the first char not the complete string "test" What is the issue. int _tmain(int argc, _TCHAR* argv[]) { printf("The number of Argc %d %s",argc,argv[1]); return 0; }
Upvotes: 1
Views: 235
Reputation: 37945
You are using UNICODE encoding (see the _t
prefix in _tmain
and _tchar
).
This encoding stores characters on 2 bytes.
Hence you should use _tprintf
instead of printf
.
Upvotes: 3