| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
|
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 |
| write program for palindrome | | 3 |
| How can you find the nodes with repetetive data in a linked
list? | Lucent | 1 |
| How many bit combinations are there in a byte? | Intel | 7 |
| How do you link a C++ program to C functions?
| | 2 |
| What is problem with Runtime type identification?
| | 1 |
| What is the Maximum Size that an Array can hold? | Satyam | 31 |
| tell me about yourself ?i want answer for frehers with
various exasmples? | HCL | 2 |
| Why preincrement operator is faster than postincrement? | | 3 |
| this is to swap to strings....but in output the whole
strings are swapped leaving first as it is...why it is so
#include<iostream.h>
int main()
{
char a[]="ajeet";
char b[]="singh";
long x=*a;
long y=*b;
cout<<x<<":"<<y;
x=x+y;
y=x-y;
x=x-y;
*a=x;
*b=y;
cout<<x<<":"<<y;
cout<<&a<<endl;
cout<<&b<<endl;
} | | 1 |
| What is the difference between public, private, protected
inheritance? | Wipro | 4 |
| 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 |
| wrong statement about c++
a)code removably
b)encapsulation of data and code
c)program easy maintenance
d)program runs faster | | 8 |
| Why do C++ compilers need name mangling? | Lucent | 1 |
| When to use Multiple Inheritance? | | 4 |
| Do we have private destructors? | Symphony | 9 |
| What are advantages and disadvantages of Design patterns? | IBM | 2 |
| Can you explain the term "resource acquisition is
initialization?" | | 1 |
| Which uses less memory?
a)
struct astruct
{
int x;
float y;
int v;
};
b)
union aunion
{
int x;
float v;
};
c)
char array[10];
| Quark | 3 |
| What is the difference between operator new and the new
operator? | Wipro | 1 |
| |
| For more C++ General Interview Questions Click Here |