I was just wandering if there was a way to put information in to a string but increment a section of the text when putting it in the string.

To put it simply:

string="to be put in string[this is to be incremented]";

I was wandering if there is a way to do this.

6 Years
Discussion Span
Last Post by Lillylionhert

What do you mean "incremented"?
Are you wanting to set up a counter and then increment the counter in a loop and append or insert it into a string inside some brackets?

have you looked up sprintf() ?

Edited by thines01: n/a


Thank you for the reply but i have just figured out what was wrong with my program.
The increment bit was to replace the bit that i thought wasn't working.
All i had to move was move the printf section up a few lines to be above my memset.
Again thanks for the reply.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.