Hope you guy can give answer my problem.
I notice that there will be 4Bytes of memory leak on each time i run this code. Is this due to the lpszPtr variable is not been delete?PHP Code:void functiona (HWND hWnd)
{
char *lpszMesage=NULL;
char *lpszTmp=NULL;
char *lpszPtr=NULL;
lpszMessage = new char[14];
strcpy(lpszMessage, "1234567890...");
lpszPtr = lpszMessage
lpszPtr++;
MessageBox(hWnd, lpszPtr, "Data #1", MB_OK);
lpszTmp = new char[10];
strcpy(lpszTmp, "123456789");
lpszPtr = lpszPtr + 5;
lpszPtr = lpszTmp;
MessageBox(hWnd, lpszPtr, "Data #2", MB_OK);
delete [] lpszTmp;
delete [] lpszMessage;
}
regards,
Chris.C




Reply With Quote