I have the following extremely simple code:
void AllocateMemory(float* M, int n)
M = new float[n];
int main(int argc, char* argv)
float* k = NULL;
if (k) //k is still NULL ????
delete  k;
In the main function, I have declared a pointer and I want to allocate memory for this pointer in another function (AllocateMemory). However, after calling function AllocateMemory, the value of k is NULL.
What am I missing here?