Mail Archives: djgpp/2000/06/07/20:51:57
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 <stdio.h>
#include <conio.h>
void waitkbd(void);
int main(int argc,char **argv)
{
int c;
printf("\n ");
for(c=1;c<argc-1;c++)
printf("%s ",argc[c]);
waitkbd();
return(0);
}
void waitkbd(void)
{
while(kbhit()) getch();
getch();
}
- Raw text -