Prev Index Next

I/O for Classes

In C++, the common approach for doing I/O of a class is to overload the << and >> operators for the class. Overloading of these operators has not yet been implemented in C* (partly due to parsing difficulties and interaction between these operators and the unary built-in I/O operators, and partly because implementation is tied in with the standard library, which doesn't exist yet). In the meantime, programmers can define regular functions to do I/O, using the C standard library functions (see the compatability section). Also, if programmers define a cast from their class type to char[], this would allow the class to be output with the built-in output operator.


Prev Index Next