My code is something like this in C++
MyObject* someObject;
void makeArray(int sizeArray)
{
someObject = (MyObject*) malloc(sizeof(MyObject) * sizeArray);
}
Now this compiles without any errors or warnings, but when I run the program it instantly crashes. I have also tried to hardcode the array in, and I do have enough memory for it. I haven't used malloc too much, so I probably have something coded wrong, but if that's the problem, what is it?