Mail Archives: djgpp/1997/10/25/01:16:26
At 02:08 10/24/1997 -0600, H.W. Stockman wrote:
>Jon Seanor wrote:
>>
>> Just a quick question.
>>
>> I'm forever forgetting the syntax for reading the command line, i.e. passing
>> it to the main function as parameters. Do you know what the syntax is?
>>
>> void main(char* argv[], int argc) <---is this right?
>> {}
>
>order reversed -- argc first. That should be in just
>about any C book...
And it is `int main', NOT `void main'. `main' MUST ALWAYS return `int'. This
is the correct declaration:
int main(int argc, char *argv[])
{}
Nate Eldredge
eldredge AT ap DOT net
- Raw text -