I want to get output some thing like this..
Word_1
Word_2
Word_3
.
.
.
Word_1234
etc...
I have seen sprintf and itoa etc to format string, to convert int to string. In case of sprintf I have to declare size.
With "Word_"+itoa(iterator_variable), I think I can get what is needed. But is there any better way to get the desired output?
"Word_"+itoa(i)?+=operator. If you just want to output the strings and don't have to remember them, you can probably get away withprintf("%s%d\n",string.c_str(),int);orcout << string << int << endl;intto astringfirst. Which is why OP useditoa