using sscanf

How can I separetely extract the string and int after "dribble" ? (sscanf must limit TEXT to 9 chars to avoid buffer overflows.)

How come this code does not work with "dribbletext08" but does with "dribbletext05" ?

int main(void)
{
    char TEXT[10] = "";
    int NUMBER = 0;

    sscanf("dribbletext08", "dribble%9[^0-9]%i", TEXT, &NUMBER);

printf("%s\n%i\n", TEXT, NUMBER);

    return 0;
}

If you give the 5 it will work correctly. But if you give 8 it will take the value as octal value. So that only it is not working.

Thanks. Yes, actually according to the man page, %i has a different meaning according to the context. Therefore, just use %d instead.