I'm sorry, I forgot to post string_copy()'s definition:
string string_copy(string source, int startpos, int length)
{
string final;
final = "";
for (int i = startpos; i <= length; i++)
final += source[i];
return final;
}
the idea with that function is to return a 'length' substring of 'source', starting at 'startpos'.
the idea of all this was to take a string containing several lines, each seperated by a newline (\n) and put each line into a seperate element of the array statements.
the variable last_flushed is so it puts a substring of 'code', between last_flushed (the end of the last string put into the array) and i (the position of the next \n) and not everything from the beginning to whatever newline it encounters.
@coldDeath: size() is a member of std::string. code.size() returns the length of the string 'code'.