Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. //header
  2.  
  3. class Foo {
  4. public:
  5.   Foo();
  6.   Foo(const Foo& that);
  7.  
  8.   Foo& operator=(const Foo& that);
  9.  
  10.   float x;
  11. };
  12.  
  13. //source file
  14.  
  15. Foo::Foo() {
  16.   x= 0;
  17. }
  18.  
  19. Foo::Foo(const Foo& that) {
  20.   x= that.x;
  21. }
  22.  
  23. Foo& Foo::operator=(const Foo& that) {
  24.   x= that.x;
  25.   return *this;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement