What I\'m trying to do right now is to create an array with a length that is defined by a variable. However, when I put the variable in the array length, it gives me a \"Va
C++ doesn't support declare variable length array. So to use a array with a length you may
Assume a big number which is highest possible length of your array. Now declare an array of that size. And use it by assuming that it an array of your desire length.
#define MAX_LENGTH 1000000000
glm::vec2 tex[MAX_LENGTH];
to iterate it
for(i=0; i
Note: memory use will not minimized in this method.
Use pointer and allocate it according your length.
glm::vec2 *tex;
tex = new glm::vec2[test];
enter code here
for(i=0; i
Note: deallocation of memory twice will occur a error.
Use other data structure which behave like array.
vector tex;
for(i=0; i