| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| program to print this triangle
*
* *
* * * | | 5 |
| Brief explaination about #include<iostream.h>,
cin and cout | | 3 |
| How can you find the nodes with repetetive data in a linked
list? | Lucent | 1 |
| 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. | | 8 |
| Explain working of printf? | | 4 |
| What is Virtual Inheritance? | Wipro | 2 |
| What is the difference between method and message? | HP | 2 |
| what is the size of a class which contains no member
variables but has two objects??? is it 1 or 2?? | | 2 |
| Why do C++ compilers need name mangling? | Lucent | 2 |
| You have to take 2 arrays of length 10. Input the values of
array 1 from the user. Then copy the values of array 1 to
array 2 in ascending order
For example if user enters 9, 5, 6, 8, 1, 0, 2, 7, 4, 3
then copy the smallest element i.e. 0 first followed by 1,
2 and so
| | 1 |
| what is the order of initialization for data? | TCS | 6 |
| What about Virtual Destructor?
| Virtusa | 1 |
| int f() {
int I = 12;
int &r = I;
r += r / 4;
int *p = &r;
*p += r;
return I;
}
Referring to the sample code above, what is the return value
of the function "f()"?
a) 12
b) 15
c) 24
d) 17
e) 30
| Quark | 2 |
| How many types of casting are there in C++?
When is a dynamic cast,static_cast,reinterpret cast used? | CTS | 1 |
| What is the Difference between "printf" and "sprintf"? | iSoft | 5 |
| Write any small program that will compile in "C" but not
in "C++" | Honeywell | 9 |
| What are advantages and disadvantages of Design patterns? | IBM | 3 |
| Write the program for fibonacci in c++? | Wipro | 7 |
| In a class only declaration of the function is there but
defintion is not there then what is that function?
| Hughes | 4 |
| How do I open binary files? | | 1 |
| |
| For more C++ General Interview Questions Click Here |