Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Inhertance
1. #include<iostream>
using namespace std;
// Here i can use inheratance process
// i use class template
class waqar{
public:
//here i can use public , private or protected
// if i use private or not this by default private
// here i declear data types
int a;
string b;
public:
void input(){
cout<<"Enter your roll numbern";
cin>>a;
}
void output(){
cout<<"Your Roll No is = "<<a<<endl;
}
// this is just use of simple class
};
//here i can use parent & child class
2. // waqar is my parent class
// shah i use as child class
//through child class i access the main body of the class waqar like private etc
// every thing of the parent class
class shah: public waqar
{
public:
void hussain(){
cout<<" your name n";
cin>>b;}
};
main(){
shah d;
d.output();
}