Advertisement
Guest User

Example

a guest
Apr 25th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. class CClass
  2. {
  3. public:
  4.     CClass( int* _piValue ) :
  5.         m_piValue( _piValue )
  6.     {}
  7.  
  8.     void SetValue( int* _piValue )
  9.     {
  10.         this->m_piValue = _piValue;
  11.     }
  12.  
  13. private:
  14.     int*    m_piValue;
  15. }
  16.  
  17. int main()
  18. {
  19.     int iValueA = 5;
  20.     int iValueB = 6;
  21.  
  22.     CClass cls{ &iValueA };
  23.     cls.SetValue( &iValueB );
  24.    
  25.     return ( 0 );
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement