Error Message
Has anyone ever experienced the error *Z_Free: Memory Block wrote past end*?
Thanks in advance,
{CS}
When you delete''d or free()''d an object, it detected that you wrote past the end of it, perhaps you have code like this:
Your call to new[strlen(mystring)] didn''t allocate space for the trailing null that gets added to the end of the string, so when you delete[] that array, you''ll get an error like the one you described.
codeka.com - Just click it.
char mystring[] = "Hello World";char *buffer = new char[strlen(mystring)];strcpy( buffer, mystring );
Your call to new[strlen(mystring)] didn''t allocate space for the trailing null that gets added to the end of the string, so when you delete[] that array, you''ll get an error like the one you described.
codeka.com - Just click it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement