After i create an array of a class object how do i access a private member of an element of the array ??
example:
array of objects in c++
class student
{private:
int ID;
char name;
public:
get_data();
print();
};
student stan[10];
how do i access stan[2].id if i want to change that id # alone ...
Search found 1 match
- Sun Apr 10, 2022 7:43 pm
- Forum: Off-topic
- Topic: Arrays Classes and C++
- Replies: 12
- Views: 8248