Can we declare an array dynamically in structures ?
as in if that array is a variable of that structure...
When arrays are members, they still work the same way as everywhere else.
If its not a member..if its that structure's variable (declared in main)...then what ?
hi,
give some code example of your implementation or could you be more specific ?
You define a pointer in the structure, and then when you need the array, you make it using new and point to it with the pointer in the structure.
Alternatively, just put a vector in the structure.
Last edited on