제목 : 22.2. 이항 연산자 오버로딩(중복) : 연산자중복_논리연산자.cpp
    
    
        
            
                | 
                    글번호:
                 | 
                
                 | 
                
                    170
                 | 
            
            
                | 
                    작성자:
                 | 
                
                 | 
                
                    
                        레드플러스
                        
                        
                    
                 | 
            
            
                | 
                    작성일:
                 | 
                
                 | 
                
                    
                        2005/08/21 오후 9:02:22 
                    
                 | 
            
            
            
                | 
                    조회수:
                 | 
                
                 | 
                
                    
                        4724
                    
                 | 
            
            
        
     
 
    
	
	
    
	#include <iostream.h>
class A
{
public:
    int x;
    int y;
    int operator==(A aap);
};
int A::operator ==(A aap)
{
    if((x == aap.x) && (y == aap.y))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
void main()
{
    A ap;
    ap.x = 10, ap.y = 20;
    A bp;
    bp.x = 20, bp.y = 20;
    if(ap == bp)
    {
        cout << "같다." << endl;
    }
    else
    {
        cout << "다르다." << endl;
    }
}