classes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • help1267
    New Member
    • Aug 2006
    • 10

    #1

    classes

    Hi,

    Can somebody provide me with an example on how one can transfer data from one class to another ?

    I have one class 'processing' information that I then want to update into the "master_dat a" class. I then want to use the int main () to access the master_data class variables to output info.

    Example:
    The "processing " class would output "int x". How do I get "int x" to the master_data class for further manipultion and data 'storage'.

    P.S. Please "dumbify" your explanation as I'm new to this. :)

    Thanks!
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    It's not really clear what you want.

    Code:
    class Master
    {
    public:
      int a;
    }
    
    class Processing
    {
    public:
       int z;
    }
    
    int main()
    {
       Master m;
       Processing p;
    
       p.z = 10;
    
       m.z = p.z;
    }
    ???


    Of course out could overload the = operator to take a RHS of Parocessing &

    Comment

    Working...