Name: Anonymous 2007-03-23 1:52 ID:691HhKaB
Hey, I'm developing using Allegro, and it uses C-style strings, which is starting to become a pain. For example, I have code such as:
addMessage("%s %d", getName().c_str(), getAge());
addMessage is just a printf kind of function that uses variable arguments to create a string that will go to Allegro's textout, which takes a char * among other things. This works fine, but what I'd rather have is something like:
addMessage << getName() << " " << getAge();
So, I really just need to do something with strings and streams. Could someone help me out with what specifically needs to be done to implement this?
addMessage("%s %d", getName().c_str(), getAge());
addMessage is just a printf kind of function that uses variable arguments to create a string that will go to Allegro's textout, which takes a char * among other things. This works fine, but what I'd rather have is something like:
addMessage << getName() << " " << getAge();
So, I really just need to do something with strings and streams. Could someone help me out with what specifically needs to be done to implement this?