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   To Refer this Site to Your Friends   Click Here
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
why the size of an empty class is 1
 Question Submitted By :: Ekta Gupta
I also faced this Question!!     Rank Answer Posted By  
 
  Re: why the size of an empty class is 1
Answer
# 1
its because an empty class  makes an entry to symbol table (code segment) 
which requires a symoblic mapping of 1 byte
 
Is This Answer Correct ?    1 Yes 1 No
Abhishek
 
  Re: why the size of an empty class is 1
Answer
# 2
it is becuse each oject must have a different address.
 
Is This Answer Correct ?    1 Yes 3 No
Kamna
 
 
 
  Re: why the size of an empty class is 1
Answer
# 3
Because the fundamental size is a char [viz 1 byte by
default on any 32 bit or 64 bit machine].
 
Is This Answer Correct ?    1 Yes 1 No
Surender A
 

 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
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
Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1 Quark1
why we cant create array of refrences  2
What is a mutex and a critical section.Whats difference between them?How do each of them work? CTS1
When the design recommends static functions? Symphony1
What is the Difference between "C structure" and "C++ structure"?  4
What is conversion constructor? TCS1
What are the advantages and disadvantages of using inline and const? TCS1
Can you explain the term "resource acquisition is initialization?"  1
class basex { int x; public: void setx(int y) {x=y;} }; class derived : basex {}; What is the access level for the member function "setx" in the class "derived" above? a) private b) local c) global d) public e) protected Quark1
What are the different types of polymorphism?  2
What are the different types of Storage classes?  3
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; Quark1
Difference between static global and global? Symphony8
What are advantages of C++ when comparing with C? HP3
Consider a c++ template funtion template<class T> T& Add(T a, T b){return a+b ;} if this function is called as T c = Add("SAM", "SUNG"); what will happen? What is the problem in the template declaration/ How to solve the problem. Samsung4
"How will you merge these two arrays? Write the program Array: A 1 18 22 43 Array: B 3 4 6 20 34 46 55 Output Array: C 1 3 4 6 18 20 22 34 43 46 55" HCL5
What are advantages and disadvantages of Design patterns? IBM3
How can you find the nodes with repetetive data in a linked list? Lucent1
How Virtual functions call up is maintained?  2
 
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