Question on typedef, structures
Is this possible? if so what does it mean?
Code:
1 typedef struct tree{
2. int height;
3. int width;
4. int weight;
5. } banyan;
6. int main(){
7. banyan* count[2]; // This is the statement I am interested in
8. count[0].height = 100;
9. count[0].width = 10;
10. return 0;
}
I do know about typedefs. For eg, we can make an instance of the type tree because of statement 1 (typedef struct tree).
but what is the meaning of statement 7? where we are instantiating something of type banyan, which is an instance of type tree. banyan is just an instance isnt it?
The above program is just a sample. please let me know if something else has to be added for the above to make sense.
thanks