Date: Fri, 24 Oct 1997 22:13:18 -0700 (PDT) Message-Id: <199710250513.WAA07733@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: hwstock AT swcp DOT com, djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Reading the command line Precedence: bulk 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