Question

7. What is the output of this code? Discuss about your answer #include <iostream> using namespace std: class CMyClass { public: static int m i: CMyClass myObjectl; CMyClass myObject2; CMyClass myObject3 int main) < myObject1.m i-1 my0bject2.m i = 3;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

note:- If you have any query then comment below.please upvote. thankyou

Answer:-

#include<iostream> using namespace std; class CMyClass public: G:\HomeworkLib datalprogram\hs.exe static int m i; rocess returned

Explanation:-

In above code the class CMyClass have three object named myObject1,myObject2,myObject3. and the initialization variable m_i is static type .once if initialize then can't change.that why its outputing 1,1,4,4 through the value accessing by their object

Add a comment
Know the answer?
Add Answer to:
7. What is the output of this code? Discuss about your answer #include <iostream> using namespace...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT