This gives me an error ^^ Anyone mind helping out? I'm trying to make a "backspace" button haha.
- Code: Select all
sprintf(CHAONAME, "%s", strlen(CHAONAME)-1);
This code crashes GE XDD
sprintf(CHAONAME, "%s", strlen(CHAONAME)-1);
sprintf(CHAONAME, "%i", strlen(CHAONAME)-1);
lcl wrote:strlen() returns an integer, not a string, so your code should be:
- Code: Select all
sprintf(CHAONAME, "%i", strlen(CHAONAME)-1);
CHAONAME[strlen(CHAONAME) - 1 * (strlen(CHAONAME) > 0)] = NULL;
Hblade wrote:Thanks dood!
but it keeps the first letter D: I think I can fix this though ^^
strcpy(text, CHAONAME);
Hblade wrote:Well, it keeps it lol but it gets overwritten so its good
if(strlen(CHAONAME)>0) {
//make chaos name appear }
else {
//eithe rmake the text blank, but in my case change the text to "NO_NAME"
}
Users browsing this forum: No registered users and 1 guest