I've just got a question about text handling.
With PocketFrog I used to read text from a text file using _fgetts. Now I use readLine in GledPlay.
I am just not sure how to copy various parts of the text that I have read into another variable. Wow I hope I make this clear enough.
When I copy some of the characters over to the temp it seems that the whole of buf from buf[86] is copied and not just one character at a time.
Then when I null terminate ('\0') temp it seems that the characters are still there. For instance when I use the font class to render the text in temp it displays the characters that I copied plus the rest of the characters that were in buf.
Is there a different proper way to copy some text from the buffer that was read? Sorry I am still rather new to this and I hope this question makes sense.
Thanks guys.
With PocketFrog I used to read text from a text file using _fgetts. Now I use readLine in GledPlay.
I am just not sure how to copy various parts of the text that I have read into another variable. Wow I hope I make this clear enough.
- Code:
TCHAR buf[119];
TCHAR temp[21];
textFile.readLine(buf, 0);
for (i=0;i<20;i++)
{
temp[i] = buf[i+86];
}
temp[21] = '\0';
When I copy some of the characters over to the temp it seems that the whole of buf from buf[86] is copied and not just one character at a time.
Then when I null terminate ('\0') temp it seems that the characters are still there. For instance when I use the font class to render the text in temp it displays the characters that I copied plus the rest of the characters that were in buf.
Is there a different proper way to copy some text from the buffer that was read? Sorry I am still rather new to this and I hope this question makes sense.
Thanks guys.