Re: CLIL source code from book "Firmware demystified"




"Roman Mashak" <mrv@xxxxxxxx> wrote in message
news:d9vfh0$2uir$1@xxxxxxxxxxxxxxxxx

> EMG> int valid_options(int argc, char *argv[], )

> I don't quite understand WHY I can pass 'argc' and 'argv' to another
> function? The reason I ask this is every command I type in command line is
> not a seperate process, it's run in the whoel scope (according to the book
I
> mentioned before). And originally 'argc' and 'argv' are valid for
> single-running processes, not as a part of any code.

I don't understand your non-understanding. argc and argv have lifetime
throughout the execution of the process in question. The first is
an integer, and the second is a pointer to a (effectively constant)
array of strings. If you need to be able to use these anywhere in your
code (for a single process) you can. What is it that you expect not
to be able to do ?

In particular, what do you mean by "single-running processes, not as
a part of any code" ?

Richard [in PE12]


.



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: cpmmand line arguments
    ... You cannot compile or run command line arguments. ... Obviously argc and argv can be any legal identifier but these two names ... The general method is to first test argc. ...
    (comp.lang.c)
  • Re: Command line arguments without argc and argv
    ... > Is it somehow possible to retrieve the command line arguments of a program ... > without using argc and argv? ...
    (comp.os.linux.development.system)
  • Re: Command line arguments
    ... The following program prints all given command line arguments: ... argc is guaranteed to be non-negative ... argv is an array of pointers to strings holding ... argv[argc] is guaranteed to equal NULL ...
    (comp.lang.c)
  • 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)

Quantcast