Newsgroups: comp.os.msdos.djgpp From: fredex AT fcshome DOT stoneham DOT ma DOT us (Fred Smith) Subject: Re: Problem compiling program with command-line arguments Organization: None! Message-ID: References: Date: Wed, 9 Sep 1998 11:02:27 GMT Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Goh Yong Kwang (s6606555 AT mercury DOT np DOT ac DOT sg) wrote: This is probably off-topic for this newsgroup, but what the heck.... : =================================================== : #include : // This program prints out all arguments passed to it from the command. : main(char *argv[], char argc){ Bingo! You've got the parameters backwrds, the first one is the argument count (argc) and the second one the argument vector. Also note that argc is an int, not a char. It should read: main(int argc, char *argv[]){ -- ---- Fred Smith -- fredex AT fcshome DOT stoneham DOT ma DOT us ----------------------------- For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord ------------------------------ Romans 6:23 (niv) ------------------------------