Thanks for presenting two different methods to do this. I got stringstreams working in a test program, but sprintf causes some wierd characters instead of letters to be entered in the string and it changes the console font permanently so I have to restart it.
This program outputs "ŒÏ@•@õÿ¿" and then "balance", but in a font that looks like ncurses borders and such, and it changes the command prompt after the program is done. What am I doing wrong?
using namespace std;
int value = 7;
char title = "balance";
strcat(list, " ");
sprintf(&list[strlen(list)], "%d", value);
cout << list << endl;
If someone could point me to where I can read a basic explanation of printf and stringstreams that would be helpful. I like to understand the functions I use when I'm using them.