ok i just want to type this code out , and want someone to tell me if i have the correct understanding of inheritence..
Code:#include <iostream>
using namespace std;
class a
{
public:
int t;
a(){t =1;} //constructor
};
class b : public a
{
public
};
now i could access t varible through b like this?
or if there was more varible or functions in a could access them through b
int main()
{
b b;
cout<<b.t<<endl;
return 0;
}