Question: 3. Which line(s) in the main() will generate error? Explain your answer. #include using namespace std; class classP { public: int 11-1; protected: };
3. Which line(s) in the main() will generate error? Explain your answer. #include using namespace std; class classP { public: int 11-1; protected: }; int 12 - 2; class classQ private classP{ public: }; int 13 = 3; class classR { protected: }; int 14 = 4; class classs public classQ, protected classR { protected: }; int 15 = 5; int main() { classP p; classQ q; class r; classs s; cout < < p.11 < < endl; cout < < p.12 < < endl; cout < < q.11 < < endl; cout < < q.12 < < endl; cout < < q.13 < < endl; cout < < r.14 < < endl; cout < < s.11 < < endl; cout < < s.12 < < endl; cout < < s.13 < < endl; cout < < s.14 < < endl; cout < < s.15 < < endl; return 0; (4 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
