Announcement

Collapse
No announcement yet.

Class Best Friend

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Class Best Friend

    PHP Code:
    #include <iostream>
    #include <string>

    using namespace std;



    class 
    test {

        
    friend void modify (test ptrint b);
    public:
        
    test (int ain=0int bin 0int cin=0)
        :
    a(ain),b(bin),c(cin){}
        
        
    void print (){
            
    cout<< << endl;
            
    cout<< << endl;
            
    cout<< << endl;
        }
        
    private:
        
    int abc;
        
        

    };


    void modify (test ptrint value){

        
    ptr->a=value;
        
    ptr->b=value;
        
    ptr->c=value;

    }


    int main (){
        
        

        
    test obj;
        
    obj.print();
        
    modify(&obj,50);
        
    obj.print();
        
        
        
        
        
        return 
    0;



    | VFX Artist, C++ Programmer, HW Overclocker | Web: xgiovio.com Email: xgiovio@gmail.com Twitter: @xgiovio
Working...
X

Google Profile


My name is Giovanni Di Grezia, but people call me xgiovio.

Here is my homepage:.

I'm a VFX Artist and Software Developer.

Giovanni Di Grezia