nLet’s see how
“display_all” can access the data members:
äclass
list {
ä public: notice it is public
ä
int display_all() {
ä for (int i=0; i<num_of_videos;
++i)
ä
cout <<my_list[i].title <<‘\t’
ä <<my_list[i].category
ä <<‘\t’ <<my_list[i].quantity
<<endl;
ä
}
ä •••
ä private:
ä video
my_list[CONST_SIZE];
ä int num_of_videos;
ä};