examples

anyone have an example of user inputing the size of array for struct?
Tutorial -> Dynamic memory
Link to what firedraco is telling you about: http://www.cplusplus.com/doc/tutorial/dynamic/

Is this an array of structs? Or an array within the struct?
Last edited on
Dynamic allocation? If yes, is more or less this:

1
2
3
4
5
int* _myVar = 0; //first value
_myVar = new int[10]; //first size: 10
delete[] _myVar;

_myVar = new int[15]; // new allocation.  The size is 15 now. 
Topic archived. No new replies allowed.