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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories >> Software >> Programming-Languages >> C++
 
  STL (45)  OOPS (186)  C++-General (222)
 


 

Back to Questions Page
 
Question
What is public, protected, private?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
This Interview Question Asked @   Satyam
I also faced this Question!!   © ALL Interview .com
Answer
public:
public is an access specifier which can be used throughout 
the program.
protected:
protected is an access specifier which can be used in the 
specified class and its derived class...
private:
private is an access speifier which can be used whithin the 
class in which it is declared.
 
0
Khadeer.k
 
 
Answer
public:
public is an access specifier which can be used throughout 
the program.
protected:
protected is an access specifier which can be used in the 
specified class and its derived class...
private:
private is an access speifier which can be used whithin the 
class in which it is declared.

These three access specifiers are used for providing the
security
 
0
Yughandhar
 
 
Answer
public,protected,private are access modifiers where public 
is used for acess the methods and variables to unlimited 
extent.
private:is used to access the variables upto the enclosing 
region
protected:and it is limited to class itself or classes that 
are derived
 
0
Prashanth
 
 
 
Answer
they are acceses specifieres.
these are used for security purpose
 
0
Yughandhar
 
 
Question
What is the difference between class and structure?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
structure is a value type class is reference type,
struct Memory will be on stack and class Memory stored on 
Heap,
struct not suports inheritance and class can?
 
4
Guest
 
 
Answer
By default the members of struct are public.
By default the members of class  are priavte.

When an object is created to a class, constructor will be 
called automatically.
But not in struct (if structure having member function with 
structure name)
 
1
Mohan
 
 
Answer
class is a slow access because of heap memory. But struct 
is a faster in access because of stack  memory.



values are initialize at the time of declaration in class
but not in struct.
 
1
Konankiswetha
 
 
Question
What is the difference between an object and a class?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
An Object is an instance of the class
 
0
Ven
 
 
Answer
Object is a runtime entity of a class
 
0
Nk
 
 
Question
What is an object?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
object is an instance ok a class through which we can access
class member and data.
 
0
Shivanand
 
 
Answer
an instance of a class is called an object...
 
4
Hima Bindu
 
 
Answer
object is nothing but which is existing in the real world
and it has some properties,methods
 
0
Jagath
 
 
Answer
object is a real time entity it has state,behavior
ex;animals,vechiles
 
0
Devender
 
 
Answer
object is a software bundle of related state and 
behavior.it is a instance of a class.all are real world 
entity.
 
0
Pasu Nayan
 
 
Answer
In Object Oriented programming Object is a run time 
entity(requirement) that binds the methods and data(this 
methods are operated with that binded data)together.
 
5
Srikanth Gunnala
 
 
Answer
object is a variable of data type class
 
0
Rinku
 
 
Question
What is a class?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
This Interview Question Asked @   TCS , Infosys, Vcxv, Thylak
I also faced this Question!!   © ALL Interview .com
Answer
a class is a logical existence of a data containing data 
variables and member functions having relations between 
them.
 
0
Kiran Kumar.b
 
 
Answer
the wrapping up of data and functions into a single unit is
defined as the class
 
0
Anandan
 
 
Answer
In general a class is a group of objects. for example 
mango,apple, banana, grapes etc. is a group of fruits.

But in oops concept, a class is a collection of member data 
and member function.
 
0
Kumar Vishal
 
 
Answer
Collection of data members(Varibles) and methods(functions)
is called class
 
0
Madasamy.k
 
 
Answer
class is a generalisation or mould or template of an object.
 
0
K.premalatha
 
 
Answer
A class is USER DEFINE DATA TYPE.
 
0
Nayan Patel
 
 
Answer
a class is a collection of objects which contains variables 
and functions...
 
0
Khadeer.k
 
 
Answer
Class is the Collection of Methods and Datafield, in other 
word we can say class is user defined Data Types
 
0
Vijai Prakash Maurya
 
 
Answer
Class is an user defined datatype where variable and 
related code where incorporated
 
0
Ganesh
 
 
Answer
class is a collection of object.
 
0
Laxman
 
 
Answer
In OOPS, a class is the defination of an object.The class 
can contain both the charactertics and function of the 
object.Simply we say it contains  member variables and 
member function.It is a well defined object
 
5
Ramu.m
 
 
Answer
A class is a set of objects.
 
0
Rajeshkannan.g
 
 
Answer
class is a template that combines both data and function 
into a single unit.
 
0
Kalpana.t
 
 
Answer
a class is a set of objects.for ex define a class birds, it 
will contain  thec group of birds with diffrent names like 
parrot,crow,peacock etc.
 
0
Bhagavathi Chouhan
 
 
Answer
a class is a set of objects.
 
0
G.rajesh Kannan From Ccet
 
 
Answer
A class is a template or a blueprint of a user-defined type
which can contain data and methods.
 
0
Hima
 
 
Answer
A class is group of logically related data item.It has 
function of properties and methods.

A class is a blue print of objects.
 
0
Veera Theavn.m
 
 
Question
const char *

char * const

What is the differnce between the above two?
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
const char * makes the data constant

char * constant makes the pointer constant
 
0
Karthik Natarajan
 
 
Answer
const char* is a constant pointer and char * const is 
poiter to constant.
 
0
Chithra
 
 
Answer
we can assign char as a constant but we cannot assign 
constant as a character
 
0
Priya
 
 
Answer
both are has a same meaning
 
0
Priya
 
 
Answer
const char *  is the pointer to a consant variable.
char * constant is a constant pointer to a char.
 
5
Beula
 
 
Answer
both are same
 
0
Jeeva
 
 
Answer
char * const, the pointer is declared as constant. 
const char *,  the pointer is not constant.
 
0
Atreyee
 
 
Answer
const char *s;  is a non-const pointer to const char
char * const s; is a const pointer to non-const char

Once u assign a value to the const poinet it cannot be 
reassigned another value till u use casting techniques..

char a = 'A';
char b = 'B';
char *const c = &a;
c = &b; //flags an errror

const char *s = &a;
s = &b //works
 
0
P S
 
 
Question
wrong statement about c++

a)code removably

b)encapsulation of data and code

c)program easy maintenance

d)program runs faster
Rank Answer Posted By  
 Question Submitted By :: Tribhuvan Sharma
I also faced this Question!!   © ALL Interview .com
Answer
encapsulation of data and code
 
0
Chithra
 
 
Answer
program run faster
 
0
Priya
 
 
Answer
program run faster
 
0
Priya
 
 
Answer
program easy maintenance
 
0
Pooja
 
 
Answer
code removably
 
0
Subitha
 
 
Answer
code removably
 
1
Ranjit
 
 
Answer
code removable
 
0
Jitendra
 
 
Answer
code removably
 
0
Prakash
 
 
Question
what is an instance of a class
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
object
 
4
Guest
 
 
Answer
Number of entities,called objects are the instances of the 
class.
 
0
Sandeep
 
 
Question
what is pulse code modulation?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Wipro
I also faced this Question!!   © ALL Interview .com
Answer
name of the process for the conversion of analog signal 
into digital signal
 
0
Ramandeep
 
 
Question
//what is wrong with the programme??
#include<iostream.h>
template <class first>
class dd
{
	first i;
	public:
	 void set();
 void print();
};
  void dd< first>:: set()
		{
			cin>>i;
		}
 void dd< first>::print()
		{    
			cout<<"\n"<<i;
		}
void main()
{
	dd <char>g;
	g.set();
	g.print();
}
Rank Answer Posted By  
 Question Submitted By :: Ramu
I also faced this Question!!   © ALL Interview .com
Answer
template<class first> void dd<first>::set()
{
           cin>>i;
}

template<class first> void dd<first>::print()
{
           cout<<"\n"<<i;
}
 
0
Prakash
 
 
Question
who is the founder of c++?
Rank Answer Posted By  
 Question Submitted By :: Sandeep
I also faced this Question!!   © ALL Interview .com
Answer
Bjarne Stroustrup
 
4
Ven
 
 
Question
tell me about yourself ?i want answer for frehers with 
various exasmples?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
I am Sanish Joseph.I completed my B.TECH in NSS COLLEGE
PALAKKAD,Kerala in Electronics and Communication engineering.
After completing B_Tech I did ANIIT course from NIIT.In that
course I learned SQL,C++,J2SE,J2EE,VB.NET and ASP.NET.I did
my 10th and +2 in St.Thomas CHSS Thrissur.My hobbies are
drawing painting and listen to music.About my family ,my
parents are teachers and my brother is working in HCL as a
software Engineer.And I want to acquire a challenging
position where I can contribute my technical,logical and
software skills as a professional. dats al...
 
0
Sanish Joseph
 
 
Answer
I'm Leo.Now i'm undergoing MCA in St.joseph's 
college,Trichy.My strengths r 
Optimistic,Dedication,Teamwork,Respect others.My favourite 
area is OOP's.And I did ONLINE SHARE MARKET as my mini 
project in JSP(J2EE)platform.I'm a self motive  person.I 
was university football player in my UG.So that i mentioned 
ealier that i'm a good teamworker.
 
0
Leo
 
 
Question
what is object slicing?
Rank Answer Posted By  
 Question Submitted By :: Soumya_830312
This Interview Question Asked @   Wipro , L
I also faced this Question!!   © ALL Interview .com
Answer
When an base class is assinged to its derived class the 
base class takes up only the base member data leaving the 
data members of derived class.this is called...
 
0
Soumya_830312
 
 
Answer
When a Derived Class object is assigned to Base class, the 
base class' contents in the derived object are copied to 
the base class leaving behind the derived class specific 
contents. This is referred as Object Slicing.

Class Base
{
public:
  int i;
};

class Derived : public Base
{
public:
  int j;
};

int main()
{
  Base Bobj;
  Derived Dobj;
  Bobj = Dobj;  //Here Dobj contains both i and j. 
                //But only i is copied to Bobj.
}
 
0
Rsn
 
 
Answer
object slicing is the phenomenon in which when we assigned 
derived class with base class ,the separation of base class 
data members from derived class data members occur.
 
0
Susanta (rcm)
 
 
Answer
if an object of a derived class is assigned to a base class
object,the compiler accepts it.but it copies only the base
portion of the object
class base
{
   public:
           int i,j;
};
class derived : public base
{
  private:
          int k;
};
int main()
{
   base b;
   derived d;
   b=d;
return o;
}
here b contains i and j where as d contains i,j&k.On
assignment only i and j of the d get copied into i and j of
b. k doesnot be copied. on the effect object d got sliced.
 
0
Debashis Mishra,india,orissa
 
 
Question
write a piece of c++ code which allocate memory to the 50 
object of type CObj
Rank Answer Posted By  
 Question Submitted By :: Rohit
I also faced this Question!!   © ALL Interview .com
Answer
#include<iostream.h>
class CObj
{
};
int main()
{
       CObj **obj=new CObj *[50];
       for(i=0;i<50;i++)
        {
           obj[i]=new Cobj[10];
         }
}
 
0
Santhosh K
 
 
Answer
CObj *obj = new CObj [50];
 
0
Tara
 
 
Question
if 4-5 year old brother is standing on d roof with me and 
watching d moon, suddenly moon coverd by cloud then how 
will i explain d hiding of moon to my brother.
Rank Answer Posted By  
 Question Submitted By :: Jeetu
This Interview Question Asked @   MBT
I also faced this Question!!   © ALL Interview .com
Answer
i will explain moon feels sleepy so moon went to sleep by 
covering clouds as a bed sheet.
 
0
Karthickrajan
 
 
Answer
i will tell him moon is powerful like u and trying to find 
the way as u play hide and seek
 
0
Isha
 
 
Answer
I'd explain that moon is far far away and 'clouds' are 
closer than moon. You can always see the things that are in 
the path of your sight..
 
0
Cnu
 
 
Answer
I'd say clouds are a layer of abstraction, we are observers.
This phenomenon can best be explained by relation of
aggregation, the life time of the moon is not controllable
from clouds, cloud dosnt have any method. 

moon died, quite late, so lets go to bed and sleep. The MBT
people are running out of knowledge. Instead they should ask
to write an essay about software piracy
 
0
Godzilla
 
 
Answer
itell to my brother  moon covered by cloud like as the 
mother is take care of her baby.
 
0
Ramya
 
 
Answer
moon is covered by cloud as our mother takes care of us.
 
0
Ramya
 
 
 
Back to Questions Page
 
 
 
 
 
   
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