Re: CLIL source code from book "Firmware demystified"



Roman Mashak <mrv@xxxxxxxx> wrote:

> I don't quite understand WHY I can pass 'argc' and 'argv' to another
> function?

Because they're nowhere near as special as you assume them to be.
They have *no* special meaning to the language, the standard library,
or anything. Using 'argc' and 'argv' as the names of the arguments of
main() in a hosted environment is pure convention.

Any C function can have arguments called 'argc' and 'argv', of
whatever type you like. You could use them with reversed roles, just
for the perverse fun of it, i.e. let 'argv' be the count of arguments,
and 'argc' the array of strings.

--
Hans-Bernhard Broeker (broeker@xxxxxxxxxxxxxxxxxxxxx)
Even if all the snow were burnt, ashes would remain.
.



Relevant Pages

  • Re: What does "*" mean in "int main(int argc, char *argv[])"?
    ... argv- is the array of parameters passed in the command line. ... it is a pointer to an array of type char. ... You can use argc in a for loop to process the argv[] values. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Type of argc
    ... object is defined so that the size of an array is obtained by multiplying ... How is main(size_t argc, char **argv) different? ... the argv array, argv need one more element for the final NULL. ...
    (comp.std.c)
  • Re: Finding lines with a common beginning
    ... then it is a matter of copying each ARGV[1] ... through ARG[ARGC - 1] to a local array, ... reset the print flag and quit printing. ...
    (comp.lang.awk)
  • SOLVED: need to call managed code from unmanaged c++ code !
    ... Public Function(ByVal argc as Int32, ... SizeParamIndex:=0)> ByVal argvas string) as Int32 ... I tried the "Public Function(ByVal argc as Int32, ByVal/byRef argv as ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Difference between argc and argv?
    ... > What's the difference between argc and argv? ... the former tells you how large that array is. ... if you refuse to look things up in the documentation. ...
    (alt.comp.lang.learn.c-cpp)