Archived

This topic is now archived and is closed to further replies.

Using an object as a Variable in C++

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Class class{ privite: ..... protected: ..... public: .....} class object1; ..... class object2; ..... class object3; object3 = object1; Will this work? Hoping to use this to keep track of active area by using ''object3'' like a variable. (Reason I don''t test this myself is I''m not on my computer ATM, and no compiler here) Technology can either save us or destroy us. Me ... I say it will destroy us if Microsoft is the example.

Share this post


Link to post
Share on other sites
Yup, that should work fine. Note that by default, that performs a "shallow" copy (memberwise copy, with bitwise copy of primitives). If you don''t know what that means, you should probably look here.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites