Re: int main (int argc, char **argv)
From: Pete C. (x_at_x.x)
Date: 06/17/04
- Next message: Mick Brooks: "Re: header and source files inclusions"
- Previous message: Edo: "Re: header and source files inclusions"
- In reply to: Frane Roje: "Re: int main (int argc, char **argv)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Jun 2004 20:21:53 GMT
Frane Roje wrote:
> I just wanted to say that the first element of argv is the path of the
> executable.
Yes, here is what the standard has to say about it:
"
int main(int argc, char* argv[]) { /* ... */ }
In the latter form argc shall be the number of arguments passed to the
program from the environment in which the program is run. If argc is nonzero
these arguments shall be supplied in argv[0] through argv[argc-1] as
pointers to the initial characters of null-terminated multibyte strings
(NTMBSs) (17.3.2.1.3.2) and argv[0] shall be the pointer to the initial
character of a NTMBS that represents the name used to invoke the program or
"". The value of argc shall be nonnegative. The value of argv[argc] shall be
0. [Note: it is recommended that any further (optional) parameters be added
after argv. ]
"
- Pete
- Next message: Mick Brooks: "Re: header and source files inclusions"
- Previous message: Edo: "Re: header and source files inclusions"
- In reply to: Frane Roje: "Re: int main (int argc, char **argv)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|