Re: CLIL source code from book "Firmware demystified"



Hello, Everett!
You wrote on Wed, 29 Jun 2005 10:16:16 PST:

??>> Main function gets command line (comman and its arguments) from user
??>> and than pass it to appropriate function handling all functionality. I
??>> don't understand why is 'argc' and 'argv[]' is passed, because I used
??>> to think 'argc' and 'argv[]' are valid only with a program running,
??>> not function.

EMG> You certainly can pass argc and argv to another function.
EMG> One of my standard programming techniques is to have a
EMG> function such as:

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.

Still confused...

With best regards, Roman Mashak. E-mail: mrv@xxxxxxxx


.



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: CLIL source code from book "Firmware demystified"
    ... > I don't quite understand WHY I can pass 'argc' and 'argv' to another ... The reason I ask this is every command I type in command line is ... In particular, what do you mean by "single-running processes, not as ...
    (comp.arch.embedded)
  • 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: Email Address Arguments
    ... > I'm trying to parse some command line options. ... Ok an easy one nothing in @ARGV. ... Well you can start to match email addresses. ... If it is a file you could push it to a different list. ...
    (perl.beginners)