| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How many lines of code you have written for a single program? | BoA | 1 |
| 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 |
| How to avoid a class from instantiation? | Symphony | 5 |
| What are the types of STL containers? | | 1 |
| What is the difference between public, private, protected
inheritance? | Wipro | 4 |
| Why do C++ compilers need name mangling? | Lucent | 1 |
| What is Name Decoration? | Lucent | 2 |
| is throwing exception from a constructor not a good practice ? | Ericsson | 4 |
| why the size of an empty class is 1 | | 3 |
| "How will you merge these two arrays? Write the program
Array: A 1 18 22 43
Array: B 3 4 6 20 34 46 55
Output Array: C 1 3 4 6 18 20 22 34 43 46 55"
| HCL | 5 |
| Explain the difference between 'operator new' and the 'new'
operator? | Lucent | 1 |
| Difference between delete and delete[]? | TCS | 3 |
| Explain "passing by value", "passing by pointer" and
"passing by reference" ? | | 5 |
| write program for palindrome | | 3 |
| what is smart pointer & use of the smart pointer ??? | | 1 |
| What is conversion constructor? | TCS | 1 |
| Difference between Operator overloading and Functional
overloading? | HP | 3 |
| What are advantages of C++ when comparing with C? | HP | 3 |
| 1)#include <iostream.h>
int main()
{
int *a, *savea, i;
savea = a = (int *) malloc(4 * sizeof(int));
for (i=0; i<4; i++) *a++ = 10 * i;
for (i=0; i<4; i++) {
printf("%d\n", *savea);
savea += sizeof(int);
}
return 0;
}
2)#include <iostream.h>
int main()
{
int *a, *savea, i;
savea = a = (int *) malloc(4 * sizeof(int));
for (i=0; i<4; i++) *a++ = 10 * i;
for (i=0; i<4; i++) {
printf("%d\n", *savea);
savea ++;
}
return 0;
}
The output of this two programs will be different why?
| | 2 |
| How the V-Table mechanism works? | HP | 3 |
| |
| For more C++ General Interview Questions Click Here |