Pointer to Struct in function prototype

Discussion in 'Programming' started by dprundle, Jan 12, 2009.

  1. #1
    The following is a question about ANSI C.

    Let's say I have a typedef struct:

    typedef struct mytype {
    int a;
    int b;
    int c;
    } my_type;

    What would it mean if I had a function prototype similar to the following:

    my_type functionname(my_type **variable, etc etc etc.)


    Can someone give an explanation of what the pointer to a pointer is doing and why it would make sense to use this?
     
    dprundle, Jan 12, 2009 IP