Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #72.7K
~101 People Reached
Favorite Forums
Favorite Tags
c++ x 2
Member Avatar for tennis

[CODE]#include "stdafx.h" #include<iostream> using namespace std; class A { public: A(){} void setdata(int s) {t=s;} int getdata(){return t;} protected: int t; }; class B: public A { public: B(){} }; void main() { A a; a.setdata(3); B b; cout<<b.getdata(); }[/CODE] Why I cannot get an output of 3 here? Can …

Member Avatar for Narue
0
101