954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Is there a way to increment a section of the text when putting it in to a string.

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.

Lillylionhert
Newbie Poster
7 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

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() ?

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

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.
:3

Lillylionhert
Newbie Poster
7 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: