Home > Back-end >  Data members of class C operation result in its function can be passed between members?
Data members of class C operation result in its function can be passed between members?

Time:11-29

C + + data members after a member function after the operation when another member function call again the data members of the results will be kept on a member function computation results?

CodePudding user response:

Yes, as long as you put the calculation results in the member variables, a member function call, must be the result of a function,
But is limited to the same class objects, not across the class object ha,

For example, the string class, with strA and strB two objects, strA. The clear (); To empty the contents of the strA. Other functions to obtain the content of the strA, affirmation is empty, but the content of the strB certainly is not empty,

CodePudding user response:

For the static member variables, the same object can be passed
  • Related