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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  OOPS
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
What is the difference between const int *ptr and int const 
*ptr???
 Question Submitted By :: Manjunathtek
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between const int *ptr and int const *ptr???
Answer
# 1
'const int* ptr' means the value whose address is being 
held by ptr is constant and cant be changed while 
'int const *ptr' means the pointer cant be changed like it 
cant be incremented or decremented although you can change 
the date pointed to by ptr.
 
Is This Answer Correct ?    3 Yes 0 No
Abdul Sami
 
  Re: What is the difference between const int *ptr and int const *ptr???
Answer
# 2
a) const int *ptr and 
b) int const *ptr


Both actually mean the same...

Read from Right to left: 
for(a):-> ptr is a pointer to an integer Constant and 
for(b):-> ptr is a pointer to a constant integer...

..............
int *const ptr----------> ptr is a constant pointer to an 
integer...
 
Is This Answer Correct ?    1 Yes 1 No
Manjunath
 
 
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
What does the code "cout<<(0==0);" print? 1) 0 2) 1 3) Compiler error: Lvalue required  5
How would you stop a class from class from being derived or inherited. Ness-Technologies7
features of OOPS Ness-Technologies5
what is a ststic variable and stiticfunction briefly explain with exmple and in which case we use HCL1
What is an orthogonal base class?  1
what is the usage of clas templates  5
What is the difference between const int *ptr and int const *ptr???  2
Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed? EA-Electronic-Arts2
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.  2
what is the difference b/w abstract and interface? Merrill-Lynch1
What is public, protected, private? Satyam4
What is multiple inheritance ? Ness-Technologies8
what is the main difference between c and c++? Microsoft27
What is namespace?  6
what are the disadvantages of C++? ATS4
what is new modifier in C# HCL6
Can we have a private constructor ? Ness-Technologies8
What do you mean by public, private, protected and friendly?  1
What is a scope resolution operator? HP4
Difference between new operator and operator new  2
 
For more OOPS 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