1: "to clear the text or something" .
2: you already have the code,
3: its more fun than a cursor,
4: when you code your next game you'll have
a readymade hiScore name entry system..
Printable View
i was looking around, and i found this
strset
its suppossed to set all the letters of a text to a letter, but i don;t know how to use it.
It takes two arguments, the first is a pointer to the null terminated string, the second argument is the numerical value you wish to use to overwrite the string up to the null character.
can you give me an example??i keep getting an error
ok i decided to look around some more , i found this function
strcpy();
and it works! But is there any way to copy the character to the last letter of the destination string??
Strcpy is used for pass the data of string to other string.
Strcat is for past string in the final of another one.
It might be easier if you forgo the string functions and manage the message buffer yourself.
You could create a index that would start at message[0]. As users type letters insert that letter where the index points, then increment index. When your ready to print the string out insert a null character at the end.
You would need to make sure index never exceeds the size of the message buffer.
is there any easy way just to remove the last charecter of a string??
Inserting a null should do what you want to do.
how would i do that??