I shall explain all, so expect a long bit of text.
First use code blocks, much nicer ["code"] and ["/code"] (without quotes) make everything awesome :P
int length = content.length()
content is the name of the string passed into the function, .length() appended to a string returns an integer value representing how long the string is.
for loops are very useful, as are while loops. Learn them, master them, thank me later. here's a good place to read up on them http://www.cplusplus.com/doc/tutorial/control/
I use the variable i as an iterator, as in for each time the loop is run, i is increased by one.
content[i] represents the specific character being set into "a" the [i] makes it dependent on the iteration of the loop. Your next two lines are correct.
you would apply this by calling the function like so
timed_text("this is my string", .1)
if you are going to directly put in text, it has to be in quotes. Otherwise you have to put in a variable string name such as
1 2
|
string mystr = "something";
timed_text(mystr, .1)
|
you can also do math for the second argument call, such as the following
1 2 3
|
string mystr = "something"; //declares a variable called string set equal to "something"
double mydub = .1; //declares a double variable equal to .1
timed_text(mystr, mydub+.1)
|
as long as the second argument is convertible to a form of double, it can be used as the second argument.