#include
using namespace std;
class base
{
public:
virtual void fun() { cout <<"base"; } //this is
virtual function
void run() { fun();}
};
class der:public base // base class is
inherited
{
public:
void fun()
{ cout <<"derived"; }
};
int main()
#include
using namespace std;
class x{
int p;
public:
x(){cout<<"constructor\n";}
x(const x &y)
{
cout<<"copy constructor\n";
}
~x()
{
cout<<" destructor\n";
}
void print()
{
cout<<"print statement\n";
}
};
x g()
{
x b;
b.print();
return b;
}
int main()
{
x b;
x t=g();
}
#include
using namespace std;
class x{
public:
x() {}
int func() const{
cout<<"it is const function\n";
}
int func() {
cout<<"it is simple functin\n";
}
};
int main()
{
x a;
a.func();
return 0;
}
why cann't it take const function?
explain it
--
You received this message because you are subs
Tell me how to write a test cases for given c program which are asked
in interview ?
Please give some examples.
Any website for it?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.co