main() command line arguments of console application
- From: "Jimbo" <cjavajim@xxxxxxxxx>
- Date: 30 Jun 2005 09:05:11 -0700
I want to use command line arguments in a console application. Yet
regardless of what was entered on the command line, argc and argv
contain bogus values. Why?
Setup:
Platform Builder 5.0, target is a CEPC, and yes, the OS does include
the console component.
Embedded VC++ 4.0 with SP4.
Code:
int main (int argc, char *argv[])
{
printf("argc = %d (0x%0X), argv = %s\n",
argc, argc, argv ? argv[0] : "NULL");
getchar();
return 0;
}
Sample output:
argc = 981293930 (0x3A7D5B6A), argv = NULL
Issue: the command line arguments contain bogus values regardless of
what was entered on the command line. That is, regardless of _how
many_ (argc) values I entered, argc is always incorrect and argv is
always NULL.
.
- Follow-Ups:
- Re: main() command line arguments of console application
- From: John Spaith [MS]
- Re: main() command line arguments of console application
- Prev by Date: Re: Need Remote Control of a CE 5.0 device.
- Next by Date: Re: how to boot nk.bin?
- Previous by thread: Need Remote Control of a CE 5.0 device.
- Next by thread: Re: main() command line arguments of console application
- Index(es):
Relevant Pages
|