| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is Memory Alignment? | TCS | 1 |
| What is virtual constructor paradigm? | HP | 3 |
| How do you link a C++ program to C functions?
| | 2 |
| What does '\r' and '\b' mean? Please explain with example.
| | 3 |
| Definition of class?
| | 10 |
| How do you test your code?
| Microsoft | 3 |
| write the prime no program in c++? | | 5 |
| How to write Multithreaded applications using C++? | Honeywell | 2 |
| How to avoid a class from instantiation? | Symphony | 5 |
| difference between c and c++? | Infosys | 8 |
| How do I open binary files? | | 1 |
| How to write a program such that it will delete itself after
exectution? | | 1 |
| class X
{
public:
int x;
static void f(int z);
};
void X::f(int y) {x=y;}
What is the error in the sample code above?
a) The class X does not have any protected members.
b) The static member function f() accesses the non-static z.
c) The static member function f() accesses the non-static x.
d) The member function f() must return a value.
e) The class X does not have any private members.
| Quark | 2 |
| What is a pure virtual function?
Why is it represented as = 0...how is the internal
implementation for the same | CTS | 3 |
| Why would you make a destructor virtual? | Lehman-Brothers | 3 |
| What is the use of static functions? | Symphony | 6 |
| When copy constructor can be used? | Symphony | 4 |
| Explain working of printf? | | 3 |
| What is the output of printf("%d")? | HCL | 25 |
| Consider a c++ template funtion
template<class T>
T& Add(T a, T b){return a+b ;}
if this function is called as
T c = Add("SAM", "SUNG");
what will happen? What is the problem in the template
declaration/ How to solve the problem. | Samsung | 4 |
| |
| For more C++ General Interview Questions Click Here |