C++ News Operator 
Author Message
 C++ News Operator

I've got some problem with the new operator.
after using the new in the following line:

Contact *partner= new Contact[MAXP];
Contact *outlook= new Contact[MAXO];

I use the delete operator at the end of the programme:

delete []partner;
delete []outlook;

and I've got an error message during the run time ( memory error message)
I know that the syntaxe is Ok, what can I do ???



Thu, 13 May 2004 21:12:27 GMT  
 C++ News Operator
It is a bit hard without knowing what exact message you got, but it probably
means you corrupted the heap somewhere in between your allocation and the
delete.

Ronald Laeremans
Visual C++ compiler team


Quote:
> I've got some problem with the new operator.
> after using the new in the following line:

> Contact *partner= new Contact[MAXP];
> Contact *outlook= new Contact[MAXO];

> I use the delete operator at the end of the programme:

> delete []partner;
> delete []outlook;

> and I've got an error message during the run time ( memory error message)
> I know that the syntaxe is Ok, what can I do ???



Fri, 14 May 2004 13:55:33 GMT  
 C++ News Operator
Can you offer more information or piece if code to reproduce here?

Leolin



Fri, 14 May 2004 14:54:05 GMT  
 C++ News Operator
You must call delete for every call for "new"
So propably you called new more than one time and called delete one time at
the end

Quote:
> I've got some problem with the new operator.
> after using the new in the following line:

> Contact *partner= new Contact[MAXP];
> Contact *outlook= new Contact[MAXO];

> I use the delete operator at the end of the programme:

> delete []partner;
> delete []outlook;

> and I've got an error message during the run time ( memory error message)
> I know that the syntaxe is Ok, what can I do ???



Sat, 15 May 2004 18:52:04 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Borland C++ 4.02 (Good News and Bad News)

2. Reply news is listed as separate message in my news reader

3. Where can I found e-mail news conference about C++ latest news and discusions about C++ like a language ...

4. Access C/C++ Newsgroups via the web - Free Web based News server

5. C++ News groups.

6. news server for c++?

7. Send Message to myButton in Visual C++ - RR news.zip [0/1]

8. Any news on Visual C++ v7?

9. does C++ allow for definition of cast operator

10. MFC App + Managed C++ : Release compiles, Debug DOESN'T (operator new issue)

11. using new operator for allocating an array of strings in c++

12. C/C++ operator precedence chart for emacs?

 

 
Powered by phpBB® Forum Software