Search:

Type: Posts; User: albundy

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    3,676

    getchar() best practices

    I have a program that outputs a menu, the input should be a char from stdin. Naturally, I would think to use getchar(). Are you supposed to do the following every time after you are finished...
  2. Replies
    4
    Views
    9,834

    I think I just found the answer. ...

    I think I just found the answer.

    showgroup((const struct person * const *)pgroup, 10);
  3. Replies
    4
    Views
    9,834

    Perfect, thanks for the explanation! I have two...

    Perfect, thanks for the explanation! I have two more questions.

    First, when I try to call the function, I get a warning:
    warning: passing argument 1 of 'showgroup' from incompatible pointer...
  4. Replies
    4
    Views
    9,834

    Array of const pointers to const struct

    I'm a little confused about how to use const. I have a struct person and I have an array of pointers to person structs. I want to have a showgroup() method that takes an array of pointers to...
  5. Replies
    7
    Views
    1,293

    I have something that works but I'm still not...

    I have something that works but I'm still not completely sure why my previous code did not. I think it is because you cannot change the pointer unless you pass a pointer to the pointer.



    ...
  6. Replies
    7
    Views
    1,293

    Thanks for the replies. I'm still caught up on...

    Thanks for the replies. I'm still caught up on this. In print_arrs, strs[i] is a pointer to char (the i'th string), correct? It seems I'm obviously wrong because swap_onetwo is complaining about...
  7. Replies
    7
    Views
    1,293

    String array function problem

    I've been banging my head against the wall trying to figure out why this doesn't work. Isn't strs a pointer to a pointer of char? Any help would be appreciated. Thanks.



    #include <stdio.h>...
  8. Replies
    3
    Views
    1,127

    Perfect, thanks for the quick reply! That is...

    Perfect, thanks for the quick reply! That is what I suspected but I couldn't find the answer.
  9. Replies
    3
    Views
    1,127

    Postfix incrementer and pointer question

    I'm having a hard time understanding this short snippet of code. When you pass a pointer to a function and then use the postfix increment operator, why does the value of the pointer keep its...
Results 1 to 9 of 9