2000

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                         FILE: FEBRUARY.CPP */
/*                                                                            */
/*  This is for educational purposes, YOU should not write code like this :-) */
/*  ========================================================================= */
/*                                                                            */
/*  Compiled and tested with Visual C++ V6.0                                  */
/*                                                                            */
/*  V1.00   17-FEB-2000   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream.h>

class OP
{
 public:
    OP &operator++( int i )  { cout << *this ; return *this ; }
    OP &operator++()         { cout << " "   ; return *this ; }
    OP &operator+( int i )   { cout << i     ; return *this ; }
    OP &operator+()          { cout << " +"  ; return *this ; }
    OP &operator=( OP &o )   { cout << " = " ; return *this ; }
    operator int()           {               ; return   1   ; }
} op ;

int main( void )
{
 return ( op = +++op+++1 ) + 2 ;
}