Search:

Type: Posts; User: anduril462

Search: Search took 0.03 seconds.

  1. Replies
    19
    Views
    2,925

    First, you're a bit inconsistent in when and how...

    First, you're a bit inconsistent in when and how you use argc or argc-1 and argv or argv+1 (or, you were in your last complete post, #14). Pick one method and stick to it. I recommend your...
  2. Replies
    19
    Views
    2,925

    Okay, so you need to sort the elements of argv. ...

    Okay, so you need to sort the elements of argv. argv is essentially an array of char pointers, so you are just sorting an array of char pointers. You need something like this:


    void sort(char...
  3. Replies
    19
    Views
    2,925

    Are you trying to sort each word in argv? If...

    Are you trying to sort each word in argv?

    If so, then you need to pass the entire word. For example:


    void sort(char *word, int len)
    {
    char tmp;
    // sorting algorithm loops and such...
  4. Replies
    19
    Views
    2,925

    Ahh, I get what you're after. Just make the argc...

    Ahh, I get what you're after. Just make the argc and argv parameters in the other function look like the ones in main, then pass argc and argv from main to that function, no need for any extra *,...
  5. Replies
    19
    Views
    2,925

    argv is an array of pointers to char*, thus,...

    argv is an array of pointers to char*, thus, *argv is just a pointer to char, it's equivalent to *(argv + 0) which is equivalent to argv[0]. So you are calling print_array with just the first...
Results 1 to 5 of 5