[Dev-C++] Printf-style argument list & Overloading the << and >> operators
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-03-22 23:32:20
|
I am writing a (hopefully) portable socket class wrapper
for use with a MUD server I am helping develop. We would
like to take all the conversions of different types to
c-style strings (wont have to worry about it elsewhere in
the code) which are used for both *NIX-style and Winsock
send function. With recieving it will be up to the rest of
the code to figure out what the user means (and what types
to put it in). I am looking for a way for the user's of
this class to be able to do something like this:
//exp_gain = integer varible with the value 600
client.send("You gained %d experience", exp_gain);
Or Better Yet:
client << "You Gained " << exp_gain << " experience";
Output:
You gained 600 eexperience
Does anyone know a good tutorial or short paper. The group
I am working with is a mix of both die-hard C programmers
and C++ programmers. To minimise problems (more complaints)
later on I would like to implement both so which ever style
the programmer is used to is avalible.
Thanks in Advance
=====
Signed
David Mcken
Life Sucks
Live with it
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
|