header:
Code:
struct termlist
{
uint32_t num_terms;
char **term;
};
int getMetaData( uint32_t specific_tag, termlist **terms);
main:
Code:
int main(int argc, char **argv)
{
uint32_t specificTag;
specificTag = atoi(argv[1]);
termlist *sample1;
getMetaData( specificTag, sample1 );
...
}
Hi, I'm really confused about pointers to structures. I'm trying to understand this snippet of code above.
The function prototype requires a double pointer to the structure, termlist **terms. But in main when calling the function only a pointer to the structure is passed, sample1.
I'm quite confused on how the function prototype requires a double pointer, but in main only a single pointer is passed.
Thanks!