Just to clear things up a bit, sprintf is not C++, it's C. If you want to be particular, the C++ way of doing things is to use a stream. Here's a bit on why you should use streams instead of sprintf in C++
http://en.wikipedia.org/wiki/Sprintf#C. ... conversion
The way you would do it is create a string stream, send i to the stream, then send "input" to the stream, and then get your string from there.
would look something like
for(int i = 0; i < 128; ++i){
std::stringstream mystream;
mystream << i;
mystream << "input";
yourfunction(mystream.str().c_str());
}
That might not be exactly right, it's almost 3AM :D You also have to do some includes, I think you need <sstream> and <string>?
My guess would be that sprintf is faster in this case, but it's also not the most "right" way of doing it. In the short term, neither speed nor correctness are likely to affect this program, but it's better to learn the right way because you can optimize later. It's best not to optomize until you know why you are optimizing! :D