I have a struct
which contains an array of int
s. I do not want to fix the size of the array as I don't know how many elements will go into it and do not want to waste memory.
An array of int pointers would be the same essentially.
I tried a pointer to an array of integers and a double pointer to no avail.
How could I accomplish this?
NOTE:
What I mean by array of int pointers is that if I set a fixed size array of int pointers then I am still wasting space, so in that sense it makes no difference with a fixed size array of int
s. The only difference is that an int
and int pointer
may be different in size.