How to pass an array of pointers to a function?
Please help me....
How to pass an array of pointers to a function?
Please help me....
**pointer
but i have got another doubt:
I have two functions f1 and f2.
f1 has a structure defined in it.(this structure is local to f1)
Now how do i pass this structure to f2.
Code:
Code:f1() { typedef struct Node { char Value [128]; char Value2 [128]; struct Node *next; } listNode; listNode* HashTable[HASHSIZE]; f2();//Now how to pass this structure to f2 }
> How to pass an array of pointers to a function?
Same as an array of any other type.
> f2();//Now how to pass this structure to f2
f2( HashTable );
would be good, where
void f2 ( listNode* HashTable[] );
Is the prototype of the function
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Hi ,
Thanks for your reply...
But i get a complier error at the place where f2(listNode * HashTable[HASHSIZE]) is defined.
The error is :
syntax error before listnode;
Please help me out....
Thanks in Advance
You're declaring your structure inside a function. Don't.
Quzah.
Hope is the first step on the road to disappointment.
Sorry, I can't extrapolate your entire code from 1 error message.
> syntax error before listnode;
Maybe you're missing a ; or a closing brace
Or you're trying to declare/define the function before you declared listnode
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.