0
Why is not working
#include <iostream> using namespace std; class person : { Protected : int id ; int name; int age; public: void store(); void display(); }; class football_player : { Protected: Int Salary; Int Numberofmatches; public: void store(); void display(); int salary (Numberofmatches) { Salary = Numberofmatches * 2 +100 } }; Class basketball_player: { Protected: Int Numberofcores; public: void store(); void display(); }; int main() { person obj1; obj.id; obj.name; obj.age; return 0; }
3 ответов
0
you created the object
obj1
Not obj
So to access class members
Use obj1.id;
Net obj.id
0
Bye the way code has many basics error
0
Where are the mistakes?