| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| 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 |
| what is static function | Patni | 2 |
| What is the difference between operator new and the new
operator? | Wipro | 1 |
| What are the differences between public, private, and
protected access? | Wipro | 3 |
| Definition of class?
| | 10 |
| implement stack using stack.h headerfile functions | Subex | 1 |
| How to reduce a final size of executable? | | 1 |
| class Alpha {
public:
char data[10000];
Alpha();
~Alpha();
};
class Beta {
public:
Beta() { n = 0; }
void FillData(Alpha a);
private:
int n;
};
How do you make the above sample code more efficient?
a) If possible, make the constructor for Beta private to
reduce the overhead of public constructors.
b) Change the return type in FillData to int to negate the
implicit return conversion from "int" to "void".
c) Make the destructor for Alpha virtual.
d) Make the constructor for Alpha virtual.
e) Pass a const reference to Alpha in FillData
| Quark | 1 |
| what is importance of data sturture in a programming
language? | L&T | 10 |
| Write the program for fibonacci in c++? | | 3 |
| Brief explaination about #include<iostream.h>,
cin and cout | | 3 |
| Explain the ISA and HASA class relationships. How would you
implement each in a class design? | | 2 |
| const char *
char * const
What is the differnce between the above two? | TCS | 7 |
| How do you know that your class needs a virtual destructor? | Lucent | 3 |
| Why would you make a destructor virtual? | Lehman-Brothers | 3 |
| What is Memory Alignment? | TCS | 1 |
| Difference between static global and global? | Symphony | 8 |
| What and all can a compiler provides by default? | HP | 3 |
| What are the differences between a struct and a class in
C++? | Wipro | 4 |
| class professor {};
class teacher : public virtual professor {};
class researcher : public virtual professor {};
class myprofessor : public teacher, public researcher {};
Referring to the sample code above, if an object of class
"myprofessor" were created, how many instances of professor
will it contain?
a) 0
b) 1
c) 2
d) 3
e) 4
| Quark | 1 |
| |
| For more C++ General Interview Questions Click Here |