[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simple c program won't compile



* Chris Gray (cgray@tribsoft.com) wrote:
> This is not. (Using "should" in the sense that it must be this way to
> compile, not be this way to be stylistically correct).  It is just
> confusing to everyone else who reads his program to have it the way
> that Mark has it.  Traditionally, argc stands for something like
> "arguments count" and argv stands for something like "arguments
> vector".  But they are just arguments to a function and can have any
> name a person wants.  So all the following are correct:
> 
> int main(void)
> int main(int foo, char **bar)
> int main(int foo, char **bar, char **baz)
> 

Well Chris you are right, the thing was i made an assumption (i should
stop making those), because the question was a bit of a newbie C question
i assumed he was a newbie, and thought that maybe he got confused with
the int main( ... ) thing, of course the compiler doesn't mind, what the
names are, but i don't recall seeing on the C books i have any reference
to the above, except for the C99 specification, so again bad assumption,
bad semantics. By the way can you explain the last one i haven't seen
that one before? My take is that foo, and bar works as expected and baz
on my tests gets the environment variables that are set. Is this
correct?

Juan Fuentes 



Reply to: