1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help redefine argv ?

Discussion in 'C' started by krille_x, Sep 3, 2010.

  1. krille_x

    krille_x New Member

    Joined:
    Sep 3, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    Im rather new to this but I want to ask how to re-define the array
    argv[] after the program main(int argc, char *argv[]) have been called?

    example

    main(int argc, char *argv[])

    //assume the program is called by: program
    //this would give argc=1 and argv[0]= program

    //but know I want to reddefine the argv inside
    //the main() after the program have been called to the
    //following e.g.

    argv={"aa", "bb"};

    //so when Im using e.g. argv[1] it should give bb,
    //argv[1][0] should give b
    //despite the program was called by program and not by program aa bb

    grateful for detailed answer and examples
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    why do u want to redefine argv[]?? don't u like the way it is??
     

Share This Page