-
December 22nd, 2012, 07:17 PM
#1
How to access argv strings?
I have:
int _tmain(int argc, char* argv[])
{
printf("drive name: %s\n", argv[1]);
It displays only the first character of the first argument on the command line.
Yet the following works as expected:
static char* myArg[2] = {"first arg","second arg"};
printf("drive name: %s\n", myArgv[1]);
That displays the entire string "second arg".
So what's wrong with my reference to argv[1]?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|