i saw that we should not use the combination of new operator and free for allocating and deallocating memory in c++..
Is this right?
is there any reason other than saying that the combination is calloc/free and new/delete?
please help me..
thanks in advance
sharathg.satya
-10
Posting Whiz in Training
Recommended Answers
Jump to PostRead the following link: http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.3
Jump to PostYes they are fairly portable, but it really depends on how you write your code. First, I would start getting the right compiler which works on most of the platforms like gcc or Comeau, but I really don't want to dive deep into that, or tell you which compiler you …
Jump to Postok the only reason is it may cause problem when it is used in any other compiler or version
There are two big reasons:
- The new operator calls constructors and the delete operator calls destructors. malloc() and free() only work with raw memory. So if you use malloc() to …
All 12 Replies
LRRR
9
Junior Poster in Training
sharathg.satya
-10
Posting Whiz in Training
sharathg.satya
-10
Posting Whiz in Training
LRRR
9
Junior Poster in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
sharathg.satya
-10
Posting Whiz in Training
sharathg.satya
-10
Posting Whiz in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
sharathg.satya
-10
Posting Whiz in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
sharathg.satya
-10
Posting Whiz in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.