Args to C progs??

Brent K. Barrett bkbarret at sactoh0.UUCP
Tue Mar 7 07:32:25 AEST 1989


In article <993 at jhunix.HCF.JHU.EDU>, c08_d103 at jhunix.HCF.JHU.EDU (Ex-God) writes:
> In article <9600003 at silver> mitchemt at silver.bacs.indiana.edu writes:
> >
> >     I am writing a program in Turbo C and would like to know how to pass
> >arguments to it from the command line after it is compiled to a .exe file.
 [Stuff removed]
>      Well, I don't know Turbo C, but if it's reasonably standard, it
> should pass an integer and an array of strings.  Try
> 
> main (argc, argv)
> int argc;
> char *argv[]
> 
> For more information, check K&R1 5.11 (p110-114) or K&R2 5.10
> (p114-118).  If someone knows Turbo C better than I do, tell me if
> that will work....
 
 Well, I know Turbo C pretty well. Yes, it's a fairly good ANSI C,
so what you stated will work and is true for Turbo C.
 
 To the previous poster, though, why didn't you consult your
reference manual? It's clearly stated how to access parameters
passed on the command line via the argc/argv combo.
    
 
 [ignore]
 
 

-- 
 "Somebody help me! I'm trapped in this computer!"
  
 Brent Barrett ..pacbell!sactoh0!bkbarret GEMAIL: B.K.BARRETT



More information about the Comp.lang.c mailing list