Have a question for all you C++ pros out there.
say I have a class defined, lets call it class test, this class has a number
of private variables and public functions. It includes a function to
print out some private data fileds ex "void test:print(void)" this
function simply does "cout << stuff" on a number of things, in effect
rinting
the fields of the object.
Now say i have some object created with this class ex:
test thing = test(....);
normally to print this thing i have to call "thing.print" I would rather
do a "cout << thing". I am fimular with overloading operators, and I would
like to know if its possible to overload the << operator somehow to do this.
Or perhaps there is another way.
Thanks for any help (Oh, I;m using Turbo C++ 4.5 if it matters)
l8tr
-Jamie
... Anything not nailed down is mine. Anything I pry loose is not nailed
--- FMail/386 1.02
---------------
* Origin: KastlerocK + Jeannette, PA + 412.527.3749 (1:129/230)
|