| Other C++ General Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How to write a program such that it will delete itself after
exectution? | | 1 |
| When to use Multiple Inheritance? | | 4 |
| what is the diff b/n c and c++
a. dynamic scoping
b. nested switching
c. declaration of variables in any code block
d. separation of compilation and linking
| Hughes | 1 |
| what is static function | Patni | 2 |
| What is the Diffrence between a "assignment operator" and a
"copy constructor"? | Wipro | 2 |
| Explain about profiling? | | 1 |
| why the size of an empty class is 1 | | 3 |
| Write a program to swap 2 chars without using a third
varable?
char *s = "A";
char *p = "B"; | CTS | 3 |
| What are the differences between public, private, and
protected access? | Wipro | 4 |
| what is difference between static and non-static variables | | 4 |
| what is the size of this class
class size
{
public:
char data1;
double d;
int data2;
char data3;
double data4;
short data5;
};
please explain the padding for these double variables. | | 6 |
| what is the order of initialization for data? | TCS | 4 |
| Which one of the following describes characteristics of
"protected" inheritance?
a) The base class has access only to the public or protected
members of the derived class.
b) The derived class has non-public, inheritable, access to
all but the private members of the base class.
c) The derived class has access to all members of the base
class.
d) The private members of the base class are visible within
the derived class.
e) Public members of the derived class are privately
accessible from the base class.
| Quark | 3 |
| 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 |
| when can we use virtual destructor? | HP | 2 |
| what is an array
| | 12 |
| What is the difference between method and message? | HP | 2 |
| What are the different types of Storage classes? | | 3 |
| If P is the population on the first day of the year, B is
the birth rate, and D is the death rate, the estimated
population at the end of the year is given by the formula:
The population growth rate is given by the formula:
B – D
Write a program that prompts the user to enter the starting
population, birth and death rates, and n, the number of
years. The program should then calculate and print the
estimated population after n years. Your program must have
at least the following functions:
1. growthRate: This function takes its parameters the
birth and death rates, and it returns the population growth
rate.
2. estimatedPopulation: This function takes its
parameters the current population, population growth rate,
and n, the number of years. It returns the estimated
population after n years
Your program should not accept a negative birth rate,
negative death rate, or a population less than 2.
| | 1 |
| |
| For more C++ General Interview Questions Click Here |