Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started