hi
i declared a structure as shown below
Struct Name
{
int *nPtr;
float *fPtr;
}
In MFC, one command button click event, i added the following code and CDocClass has the structure as a member variable
Name *str;
In constructor it is initialized to NULL
str = NULL
CDocClass::OnBu ttonClicked()
{
if(str)
{
...
User Profile
Collapse
-
hi
This is the source code that i used for several times,
for(i = 0; i < 1000; i++)
{
int *ptr = new int[20000];
for(int i = 0; i < 20000; i++)ptr[i] = 0;
delete [] ptr;
}
In the task manager, look at the virtual memory size,
when i allocate memroy the virtual memroy size increases..
and when i deallocate the virtual memory size decreases in release mode but not in... -
Deallocating memory in C++
hi
i am working in VC++.
In the foolowing code
{
int *p = NULL
p = new int[2000];
delete [] p;
}
i have allocated memeory using new and
deallocated the meomory using delete.
This releases the memory in release build.
but didn't release the memory in debug mode.
OS:Windows 2000
Can anybody help me to find the reason?
No activity results to display
Show More
Leave a comment: