Is it possible to pass a struct of a struct in a function?
Code:int foo (char* strArray, PriceType *prices) { ... }Code:validation = foo ("HelloFoo", new->prices[0]); /* new->prices is of type PriceType */
This is a discussion on Passing a pointer reference to a struct inside a struct? within the C Programming forums, part of the General Programming Boards category; Is it possible to pass a struct of a struct in a function? Code: int foo (char* strArray, PriceType *prices) ...
Is it possible to pass a struct of a struct in a function?
Code:int foo (char* strArray, PriceType *prices) { ... }Code:validation = foo ("HelloFoo", new->prices[0]); /* new->prices is of type PriceType */
What is new. what is type of new->prices?
Assuming prices is array of PriceType.
i.e
You need &new->prices[0]