Hello,
I have the following setup, where vertexArray is a pointer to float (float*). It is supposed to check if the pointer has been allocated memory for. If it hasn't, it should allocate memory, but if it's already been done it will go on to put values in the array.
int arrayLength = 10; (not really but just for showing that it has a value)
if (vertexArray == 0)
{
vertexArray = new float[arrayLength];
}
now, the first time this function is called vertexArray does not get allocated memory for, so the application crashes. Why doesn't it work? I've been told it should, and I've also tried with checking if it's NULL. Same result.
Thanks!