Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between new() and malloc()?

Answers were Sorted based on User's Feedback



What is the difference between new() and malloc()?..

Answer / nashiinformaticssolutions

• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between new() and malloc()?..

Answer / nashiinformaticssolutions

o new initializes the object and calls its constructor.
o malloc allocates memory but does not call constructors.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between new() and malloc()?..

Answer / glibwaresoftsolutions

• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between new() and malloc()?..

Answer / hr@tgksolutions.com

• new: Calls constructor, returns an object of the correct type.
• malloc(): Does not call constructor, returns void*.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

what is COPY CONSTRUCTOR and what is it used for?

0 Answers  


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

0 Answers  


What are abstract data types in c++?

0 Answers  


Is c++ an integer?

0 Answers  


Is c++ a software?

0 Answers  


What is stream and its types in c++?

0 Answers  


class HasStatic { static int I; }; Referring to the sample code above, what is the appropriate method of defining the member variable "I", and assigning it the value 10, outside of the class declaration? a) HasStatic I = 10; b) int static I = 10; c) static I(10); d) static I = 10; e) int HasStatic::I = 10;

1 Answers   Quark,


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == 4 ) y-= 7; else y = 8; Enter a segment of code (without any IF statements) that does exectly the same thing using the switch structure.

1 Answers  


Why use of template is better than a base class?

0 Answers  


What is the difference between *p++ and (*p)++ ?

0 Answers  


Explain the pure virtual functions?

0 Answers  


What is #include iostream?

0 Answers  


Categories