Advertisement
Guest User

MyString

a guest
Apr 27th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. // MyString.h
  2. #include <iostream>
  3.  
  4. class MyString
  5. {
  6.     std::string m_pStr;  
  7. public:
  8.     MyString();
  9.     MyString(std::string string);
  10.     friend std::ostream& operator<<(std::ostream& os, const  MyString& string);
  11. };
  12.  
  13.  
  14. //MyString.cpp
  15. #include <iostream>
  16.  
  17. #include "MyString.h"
  18.  
  19. std::ostream& operator<<(std::ostream& os, const  MyString& string)
  20. {
  21.     os << string.m_pStr;
  22.     return os;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement