| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| whats the size of class EXP on 32 bit processor?
class EXP
{
char c1;
char c2;
int i1;
int i2;
char *ptr;
static int mem;
}; | Huawei | 4 |
| How do you link a C++ program to C functions?
| | 2 |
| What is the difference between public, private, protected
inheritance? | Wipro | 4 |
| 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;
| Quark | 1 |
| What is design pattern? | Samsung | 2 |
| 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 |
| when can we use virtual destructor? | HP | 2 |
| 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. | Samsung | 4 |
| How many bit combinations are there in a byte? | Intel | 7 |
| Explain "passing by value", "passing by pointer" and
"passing by reference" ? | | 5 |
| Write any small program that will compile in "C" but not
in "C++" | Honeywell | 6 |
| What are the techniques you use for debugging? | Adtran | 1 |
| What are Virtual Functions? How to implement virtual
functions in "C" ? | | 2 |
| what is the size of this class
class size
{
public:
char data1;
double d;
int data2;
char data3;
double data4;
short data5;
};
please explain the padding for these double variables. | | 6 |
| What are inline functions? | Verizon | 2 |
| How long does this loop run:
for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever
| Quark | 9 |
| Is structure can be inherited? | HP | 3 |
| What is problem with Runtime type identification?
| | 1 |
| Do we have private destructors? | Symphony | 9 |
| what is difference between static and non-static variables | | 4 |
| |
| For more C++ General Interview Questions Click Here |