sohit
BAN USER- 1of 1 vote
Answers#include<iostream>
- sohit in India
#include<exception>
int main()
{
try
{
cout << "sum";
throw 3;
}
catch(...)
{
cout<< "dot";
}
catch(int a)
{
cout << a;
}
catch(exception e)
{
cout << "exception";
}
return 0;
}
what will be the output of the above program?| Report Duplicate | Flag | PURGE
Goldman Sachs Applications Developer C++ - 0of 2 votes
AnswerFor the written test please prepare the following topics throughly :
- sohit in India
a) virtual function
b) operator overloading
c) namespace
d) template
For interview, please prepare the container throughly with the implementation of list,map etc.| Report Duplicate | Flag | PURGE
Goldman Sachs Applications Developer C++ - 0of 2 votes
Answersclass a{
- sohit in United States
public:
int var1;
a(int var)
{
var1 = var;
}
};
class b: public a
{
public:
int var2;
b(int d) : var2( d++) , a(var2++)
{
}
};
int main
{
b obj1(5);
}
What will be the value of the variable 'var1' in class A?
a) 6
b)7
c) 5
d) undefined| Report Duplicate | Flag | PURGE
Goldman Sachs Applications Developer C++ - 0of 0 votes
Answersclass a{ public: int a; virtual void sum() { printf("sum"); } }; class b : public a { public: int b; virtual void sum() { printf("sum of class b"); } }; void main() { b aptr; a *bptr; bptr = &aptr; bptr->sum(); }
Output of the above program?
- sohit in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Applications Developer C++
So what will be the size of empty class on 64 bit hardware?
- sohit April 09, 2013