제목 : 22.3.1. 단항 연산자 중복 : 단항연산자오버로드.cpp
    
    
        
            
                | 
                    글번호:
                 | 
                
                 | 
                
                    303
                 | 
            
            
                | 
                    작성자:
                 | 
                
                 | 
                
                    
                        레드플러스
                        
                        
                    
                 | 
            
            
                | 
                    작성일:
                 | 
                
                 | 
                
                    
                        2007/01/25 오후 4:45:13 
                    
                 | 
            
            
            
                | 
                    조회수:
                 | 
                
                 | 
                
                    
                        4468
                    
                 | 
            
            
        
     
 
    
	
	
    
	#include <iostream>
using std::cout;
using std::endl;
class Integer
{
public:
    int value;
    Integer(int value) { this->value = value; }
    Integer operator++() {
        this->value++;
        return *this;//주의
    }
};
void main()
{
    // 기본 데이터 형식
    int x = 10;
    x++;
    cout << x << endl;
    // 사용자 정의 데이터 형식 : 클래스
    Integer a = 10;
    a.operator++();
    a++;
    cout << a.value << endl;
}