Some stuff force me to think of this case..
As far as something like..
- Code: Select all
void main () {
char sign[256] = "Game 4 Editor";
char str [6];
int i;
sscanf (sign,"%s %*s %d",str,&i);
fprintf ("%s -> %d\n",str,i);
}
Won't work, so i'm completely desperate. How you can make like..
(figuratively):
- Code: Select all
if (strcmp(string, "%s.txt") == 0 ) { if (strlen(string) >= 10) strcpy(string, "File too large") }
So only if the string ends with .txt the code is running. Maybe using fseek, but as i remember fseek, seek char by number and it does not compare strings.