| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| When the design recommends static functions? | Symphony | 1 |
| Difference between Overloading and Overriding? | HP | 4 |
| What are the different types of Storage classes? | | 3 |
| Why do C++ compilers need name mangling? | Lucent | 1 |
| When volatile can be used? | Symphony | 2 |
| Explain the difference between 'operator new' and the 'new'
operator? | Lucent | 1 |
| What is the difference between method and message? | HP | 2 |
| How many pointers are required to reverse a link list? | CTS | 2 |
| What are inline functions? | Verizon | 2 |
| Write any small program that will compile in "C" but not
in "C++" | Honeywell | 6 |
|
1. What does the following do:
void afunction(int *x)
{
x=new int;
*x=12;
}
int main()
{
int v=10;
afunction(&v);
cout<<v;
}
a) Outputs 12
b) Outputs 10
c) Outputs the address of v
| Quark | 3 |
| What does '\r' and '\b' mean? Please explain with example.
| | 2 |
| Write a program to reverse a linked list? | Catalytic-Software | 2 |
| string somestring ;
Which of the following choices will convert a standard C++
string object "somestring" to a C string?
a) Copy.somestring () ;
b) somestring.c_str ()
c) &somestring [1]
d) std::cstring (somestring)
e) (char *) somestring
| Quark | 1 |
| 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 data Abstraction? and give example | TCS | 13 |
| Write a function which takes a character array as input and
reverses it in place. | Lehman-Brothers | 2 |
| What is object slicing and how can we prevent it? | Tech-Mahindra | 2 |
| write program for palindrome | | 3 |
| What is your strongest programming language (Java, ASP, C,
C++, VB, HTML,C#, etc.)? | Microsoft | 20 |
| |
| For more C++ General Interview Questions Click Here |