I'm a beginner to C++ and am trying to check if a dynamic array needs to be expanded, and if so, expand it. But my compiler (Dev-C++) is giving me this warningCode:// Check to see if the Found array needs to be expanded if (Entry > Max) { // Give the array 30 more spaces to fill Max += 30; /* Create a temp array with the amount of space desired, if the memory cannot be allocated return an error */ Temp = new POINT[Max]; if (!Temp) { delete [] Found; LastERR = FAILED_MALLOC; return NULL; } // Loop through the original and copy it to the new array for (int iCountARY = 0; iCountARY < Entry; iCountARY++) { Temp[iCountARY] = Found[iCountARY]; } // Release the old array delete [] Found; Found = Temp; }Which I think, after a little research, means that I was trying to access memory outside of my dynamic array or something along those lines. If anyone could quickly go over what I'm doing wrong I'd really appreciate it, thanks for reading!Code:warning: heap block at 003F3CF8 modified at 003F3DF0 past requested size of f0




Reply With Quote