| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| write program for palindrome | | 3 |
| How is an Abstract Base Class(ABC) related to an "Abstract
Data Type" (ADT) | | 2 |
| Difference between static global and global? | Symphony | 8 |
| Can inline functions have a recursion? Give the reason? | | 1 |
| What is Pure Virtual Function? Why and when it is used ? | Lucent | 4 |
| What is the Diffrence between a "assignment operator" and a
"copy constructor"? | Wipro | 2 |
| 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 to swap two strings without using any third variable ? | | 3 |
| Can we declare destructor as static? Explain? | | 2 |
| wrong statement about c++
a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster | | 8 |
| What are the differences between a struct and a class in
C++? | Wipro | 4 |
| How long does this loop run:
for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever
| Quark | 9 |
| What are advantages of C++ when comparing with C? | HP | 3 |
| Difference between delete and delete[]? | TCS | 3 |
| write the prime no program in c++? | | 3 |
| What is the use of static functions? | Symphony | 6 |
| How do you link a C++ program to C functions?
| | 2 |
| What is the output of:
String a1 = "Hello";
String a2 = "world!";
String* s1 = &a2;
String& s2 = a1;
s1 = &a1;
s2 = a2;
std::cout << *s1 << " " << s2 << std::endl; | Lehman-Brothers | 4 |
| Difference between Top down and bottom up approaches for a
given project ? | HP | 1 |
| |
| For more C++ General Interview Questions Click Here |