I have a program that looks something like this:
It uses a temporary pointer to allocate memory, and if successful makes Data the pointer to this memory.Code:unsigned char* Data; unsigned char* TempData; TempData=new unsigned char[256]; if(TempData!=NULL) { Data=&TempData; TempData=NULL; } if(Data!=NULL) { delete[] Data; }
I get a suspicious pointer conversation warning when compiling. Is there something wrong with this code? It seems to work fine when running the program.