0

// find new size
nNewArraySize = StrNewSizeForCharReplace(pszString, pszFindString, pszReplaceString);

// nNewArry size is 1063

// alllocate memory
pszTemp= (unsigned char*)malloc(nNewArraySize + 1);

// add 1063 character in to pszTEmp

// 1063
nLength = strlen(pszTEmp) // length is 1063
free(pszTemp);

// Heap memory exception

How can remove this exception

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

why are you calling malloc() is a c++ program? Change it to new and see if that fixes the error. If not, then the real problem is in parts of the program that you did not post.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.