본문 바로가기
C++/학교 숙제

session_4_ex infint.h(객체 맴버변수가 string 일때)

by Beijing_KingGod 2018. 4. 11.

// infint.h
/** 숫자는 string에 저장될것.
 -inf<=infint<= +inf
**/
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

class Infint{
private:
 string Inf_num;

public:
 Infint(); //////////////////////////////////////
 Infint(int);
 Infint(string);

 //~Infint();

 int GetInt()const;
 string GetInf_num ();

 void SetNum(int);

 Infint& operator+(int); ///////////////////////////
 Infint& operator+(string);
 Infint& operator+(const Infint& Inf_o); //////
  
 void operator=(int); /////////
 void operator=(const Infint& Inf_o); //////////////////////
 
 void operator+=(int); ///////////////
 void operator+=(string); //////////////

 void operator-=(int); ///////////
 void operator-=(string);  ///////
 void operator-=(const Infint& Inf_o); /////

 void operator++(int); //////
 void operator--(int); /////////

 friend ostream& operator<<
  (ostream& os, const Infint& Inf_o);

};

 

 

 

댓글