From: "Michel Chassey" Newsgroups: comp.os.msdos.djgpp References: <01BFD0CA DOT CA780E20 AT mdm124 DOT plug-in DOT com DOT br> Subject: Re: I'm having some problems when using the special parameters for main() Lines: 54 X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Message-ID: Date: Thu, 8 Jun 2000 16:17:27 -0500 NNTP-Posting-Host: 216.95.148.93 X-Complaints-To: news AT primus DOT ca X-Trace: news2.tor.primus.ca 960495885 216.95.148.93 (Thu, 08 Jun 2000 16:24:45 EDT) NNTP-Posting-Date: Thu, 08 Jun 2000 16:24:45 EDT Organization: Primus Canada To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Probably a typo : IMHO change printf("%s ",argc[c]); for printf("%s ",argv[c]); You could also ask at comp.lang.c newsgroup. Michel Chassey Marcelo Juchem a écrit dans le message <01BFD0CA DOT CA780E20 AT mdm124 DOT plug-in DOT com DOT br>... >I'm having some problems when using the special parameters for main(). >Please, could you tell-me what am I doing wrong? >Thank you! >Marcelo Juchem, mj-me AT plug-in DOT com DOT br > >THE RESULTS AND SOURCE-CODE FOLLOW: > >--------------------------------------------------------------------------- >With the following command-line: gpp -o cmdline.exe cmdline.cpp >The results are: >--------------------------------------------------------------------------- >cmdline.cpp: In function `int main(int, char **)': >cmdline.cpp:11: invalid types `int[int]' for array subscript > >--------------------------------------------------------------------------- >With the following command-line: gpp -O3 -o cmdline.exe cmdline.cpp >The results are: >--------------------------------------------------------------------------- >cmdline.cpp: In function `int main(int, char **)': >cmdline.cpp:11: invalid types `int[int]' for array subscript > >--------------------------------------------------------------------------- >The following source code: >--------------------------------------------------------------------------- >#include >#include > >void waitkbd(void); > >int main(int argc,char **argv) >{ > int c; > printf("\n "); > for(c=1;c printf("%s ",argc[c]); > waitkbd(); > return(0); >} > >void waitkbd(void) >{ > while(kbhit()) getch(); > getch(); >}