ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  C++ General
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
Explain the difference between 'operator new' and the 'new' 
operator?
 Question Submitted By :: Jayant
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Explain the difference between 'operator new' and the 'new' operator?
Answer
# 1
The term "operator new" is used incase when u are
overloading the global "new" operator.We can overload ne
operator just as  any other operators i.e +,-,*,=etc.

The term "new operator" is used in case of dynamic
allocation of memory.When a variable is allocated memory
dynamically the new operator is used.
Eg:
int *p=new int;
//here p is pointer to integer.So in order to allocate
memory for it we have used the new operator.
    
 
Is This Answer Correct ?    3 Yes 0 No
Richa
 

 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
Disadvantages of c++  3
What is the difference between "overloading" and "overridding"?  3
1. What does the following do: void afunction(int *x) { x=new int; *x=12; } int main() { int v=10; afunction(&v); cout<<v; } a) Outputs 12 b) Outputs 10 c) Outputs the address of v Quark3
How do you know that your class needs a virtual destructor? Lucent3
Definition of class?  10
What is "strstream" ? Huawei1
Write any small program that will compile in "C" but not in "C++" Honeywell6
Which uses less memory? a) struct astruct { int x; float y; int v; }; b) union aunion { int x; float v; }; c) char array[10]; Quark3
What is the Maximum Size that an Array can hold? Satyam31
How many lines of code you have written for a single program? BoA1
if i want cin 12345678910 and cout abcdefghij. so how can i create the program?. example : if i key in 8910 so the answer is ghij.  3
What is Pure Virtual Function? Why and when it is used ? Lucent4
Can we declare destructor as static? Explain?  2
What is Namespace? Samsung1
What is your strongest programming language (Java, ASP, C, C++, VB, HTML,C#, etc.)? Microsoft20
Why is it difficult to store linked list in an array? Lucent2
What are the different types of Storage classes?  3
Write a program to reverse a linked list? Catalytic-Software2
What issue do auto_ptr objects address?  1
what is meaning of isa and hsa  1
 
For more C++ General Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com