Dear Friends
i have four question please answer these questions..........

Q1>
...
.
.
.
.
switch(iVar)
{
case 0:cout<<"Zero";
case 1:cout<<"One";
case 2:cout<<"Two";
}

if suppose now iVar value is 0
than what will be the output................

i think it should be Zero

though i know that i have not used "break" in each case

what i know about break is that after excuting some match case if no break is present than the execution fall through next case if the case matches with the value for test........

i know that i am wrong as output coming is different,please clarify my doubt.......

Q2>
what is the following code represent

template<class T>
T Run(T Process);

choices were
(a)template class declaration
(b)template class definition
(c)template function declaration
(d)template function definition

my answer was template function declaration

but the interviewer said i am wrong.........
how so?

Q3>
suppose there are two class
class A
{
private:
int num;
public:
.
.
.
.
/*other things*/
};

class B
{
private:
.
.
.
public:
void UsenumOfA();//function which uses "num" of "class A"
};

now the question was without using inheritance how i can initialise "num" of "class A" in my class B function UsenumOfA()


my answer was
by using aggregation
we would declare "A" object inside my class B and than we use inside the UsenumOfA() as shown below

class A{ . . . . .};//same as above
class B
{
private:
A obja;
public:
void UsenumOfA()
{
obja.num = 20;//some integer value
}

}

but i am getting error how so?

Q4>
last question
if i initialise the memory with "malloc" and free it using "delete"
what will happen
my answer was either application will crash or some exception will occur or soemthing else but the application would not work correctly.......

the interview said u r wrong how so?


for the Q4 i am trying right now to see the result but atleast answer the first question...

thanks
vishal