strsep basic question

This is a discussion on strsep basic question within the C Programming forums, part of the General Programming Boards category; hello forum, again i fall down onto a basic problem. i took this code from the manpage of strsep: Code: ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    14

    Question strsep basic question

    hello forum,

    again i fall down onto a basic problem. i took this code from the manpage of strsep:

    Code:
               char **ap, *argv[10], *inputstring;
    
               for (ap = argv; (*ap = strsep(&inputstring, " \t")) != NULL;)
                       if (**ap != '\0')
                               if (++ap >= &argv[10])
                                       break;
    adding something like:

    Code:
    printf("arg0:%s arg1:%s arg2:%s", argv[0],argv[1],argv[2]);
    works rather great. but i wonder how to retrieve the values now saved in argv[10] from another function.

    i tried something like:
    Code:
    int function1(char *args[10])
    {
    }
    and later tried to access the *args[10] from the calling function with no luck

    thank you for your answers,
    fc

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by fudgecode View Post
    hello forum,

    again i fall down onto a basic problem. i took this code from the manpage of strsep:

    works rather great. but i wonder how to retrieve the values now saved in argv[10] from another function.

    i tried something like:
    Code:
    int function1(char *args[10])
    {
    }
    and later tried to access the *args[10] from the calling function with no luck

    thank you for your answers,
    fc
    Ummm... that would be argv[10] ....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A basic math programming question
    By hebali in forum C Programming
    Replies: 38
    Last Post: 02-25-2008, 03:18 PM
  2. Basic question about GSL ODE func RK4
    By cosmich in forum Game Programming
    Replies: 1
    Last Post: 05-07-2007, 02:27 AM
  3. Basic question about RK4
    By cosmich in forum C++ Programming
    Replies: 0
    Last Post: 05-07-2007, 02:24 AM
  4. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 03:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21