delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/14/04:49:43

From: shijn AT tcc DOT com DOT cn
Subject: argc/argv
14 Jan 1999 04:49:43 -0800 :
Message-ID: <B0000013577.cygnus.gnu-win32@mail.tcc.com.cn>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi! Evidently gcc treats argc/argv quite differently from
Turbo C when * appears in any argvs. It always tries to
replace this argv with as many as possible matching files.
For example,

main(int argc, char *argv[])
{ int i;
  for (i=1; i<argc; i++) printf("argv[%d]=%s\n", i, argv[i]);
}

Run it with t*.c as the command argument,

Compiled with GCC, it prints:
argv[1]=Test.c
argv[2]=Text2html.c
argv[3]=Timezone.c

Compiled with Turbo C, it prints:
argv[1]=t*.c

i know nothing about any standard or coding conventions
about this, but could any of you tell me which is more
standard or conventional?
  
J. Shi

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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