Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new and delete

Status
Not open for further replies.

Leroy1981

Programmer
Jul 22, 2002
46
US
i have a class that dynamically allocates memory for storage. here is my problem. the member function that allocates the space and fills that space works fine, but another member function that is always called after the one doing the allocating gives me an access violation and will only let me process less than half the total list of info. any ideas?
 
if you could show us the offending functions, it would help.
It's hard seeing exactly what you're doing wrong with out examples If ifs and ands
were pots and pans
where would the tinkers be
 
Hello.

Have you an answer to your problem ?
I have exactly the same.
I add code in a program.
This code uses STL.
The code I add works fine but I have an access violation after. It seems a pointer is altered (this pointer is not in the same class I add in the program).
If I cut the code I add, there is no problem !
This problem appears only on win 2000 5.00.2195 SP3 and SP2.
No problem on win 2000 5.00.2195 with the same executable !
There is also no problem on win 98 (same code + recompilation).
I don't understand also ...
Best regards.
 
Could be many reasons for that errors
some of them are
-you are "delete" (ing) the pointer var. before it finish
-the methosd that you call points to the memory location before or after you declare the variable
-the size of data is greater than the reserved memory

you should check this possible ways, so if your error continue, let us see the part of code that make problems and we'll see what can we do.
 
Maybe you’re not allocating as much memory as you think ----------------------------------------
Friends are generally of the same sex, for when men and women agree,it is only in the conclusions; their reasons are always different.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top