Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #define POS false
  2. #define NEG true
  3.  
  4. StringInt::StringInt(long int num)
  5. {
  6.     this->init(abs(num));
  7.     this->sgn = (num < 0) ? NEG : POS;
  8. }
  9. //comment
  10. StringInt::StringInt(unsigned long int num)
  11. {
  12.     this->init(num);
  13. }
  14.  
  15. void StringInt::init(unsigned long int num)
  16. {
  17.     std::stringstream out;
  18.     out << num;
  19.     this->strint = StringInt::rvrs(out.str()); // reverse string
  20.     this->sgn = POS;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement