L
lezard
I can't find a good charset for my string.
The separator is ':' :-(
Look at this code
int main()
{
char *str = "titititi:tutu:toto\n";
char buf1[64];
char buf2[64];
char buf3[64];
sscanf(str, "%64s[:]%64s[:]%64s[\n]", buf1, buf2, buf3);
printf("buf1: %s\n", buf1);
printf("buf2: %s\n", buf2);
printf("buf3: %s\n", buf3);
}
I would like to have tititi in buf1, tutu in buf2 and toto in buf3
But with this scanset It doesn't work. I have tried
"%64s%*[:]%64s%*[:]%64s%*[\n]" and It doesn't work too.
Could someone help me? :]
The separator is ':' :-(
Look at this code
int main()
{
char *str = "titititi:tutu:toto\n";
char buf1[64];
char buf2[64];
char buf3[64];
sscanf(str, "%64s[:]%64s[:]%64s[\n]", buf1, buf2, buf3);
printf("buf1: %s\n", buf1);
printf("buf2: %s\n", buf2);
printf("buf3: %s\n", buf3);
}
I would like to have tititi in buf1, tutu in buf2 and toto in buf3
But with this scanset It doesn't work. I have tried
"%64s%*[:]%64s%*[:]%64s%*[\n]" and It doesn't work too.
Could someone help me? :]