Answered step by step
Verified Expert Solution
Question
1 Approved Answer
9. In the following code, indicate if the selected lines are legal or illegal: #include class small public: small( ) {size = 0;}; void k()
9. In the following code, indicate if the selected lines are legal or illegal: #include class small public: small( ) {size = 0;}; void k() const; void h(int i) friend void f (small z); private: int size; void small::k ) const small x, y; x=y; // LEGAL/ ILLEGAL? x.size =y.size; // LEGAL/ILLEGAL ? x.size -3; /7 LEGAL/ILLEGAL? void small::h(int i) void f (small z) small x, y; x =y; // LEGAL / ILLEGAL ? x.size -y.size; // LEGAL/ILLEGAL? x.size 3; /7 LEGAL/ILLEGAL? x.h(42); // LEGAL/ILLEGAL? int main) ( small x, y; x=y; // LEGAL/ ILLEGAL? x.size =y.size; // LEGAL/ILLEGAL ? x.size -3; /7 LEGAL/ILLEGAL? x.h(42); // LEGAL/ILLEGAL? std: :cout
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