delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/07/20:51:57

Message-ID: <01BFD0CA.CA780E20@mdm124.plug-in.com.br>
From: Marcelo Juchem <mj-me AT plug-in DOT com DOT br>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Subject: I'm having some problems when using the special parameters for main()
Date: Wed, 7 Jun 2000 21:52:38 -0300
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019