Hi, I'm having trouble writing a code that will make a list of strings that have an increasing number at the end of it (ex.The output would be example_1, example_2, example_3 etc.) Can anyone help?
Thanks
Hm.. I must be rusty for some reason I thought it would convert. Silly me.
Using itoa
1 2 3 4 5 6 7 8 9 10 11
char Buff[5];
string Base = "example_";
string Form;
for( int i = 1; i < MAX; ++i )
{
Form = Base;
itoa(i,Buff,10);
Form += Buff;
cout<<Form.c_str()<<endl;
}