Optional enumerators - sscanf
#1

Hello. I have a problem with a code.

if I put it this code:
pawn Код:
sscanf("1 2 3 4", "E<ii-i-i>(20,30)", quiet_enum);


    printf("%i value 1", quiet_enum[value_1]);
    printf("%i value 2", quiet_enum[value_2]);
    printf("%i value 3", quiet_enum[value_3]);
    printf("%i value 4", quiet_enum[value_4]);
That makes what I want, which is to print 20 and 30 in the value 1 and 2.
but I get an error: sscanf error: Insufficient default values.

I can fix that mistake, by:
pawn Код:
sscanf("1 2 3 4", "E<ii-i-i>(20,30,40,50)", quiet_enum);


    printf("%i value 1", quiet_enum[value_1]);
    printf("%i value 2", quiet_enum[value_2]);
    printf("%i value 3", quiet_enum[value_3]);
    printf("%i value 4", quiet_enum[value_4]);
But I would 1 2 0 0, and not what I want.

How I can fix it ?.
Reply


Messages In This Thread
Optional enumerators - sscanf - by GranaT3 - 02.11.2015, 13:15
Respuesta: Optional enumerators - sscanf - by GranaT3 - 03.11.2015, 01:21
Re: Optional enumerators - sscanf - by Gammix - 03.11.2015, 03:34
Respuesta: Re: Optional enumerators - sscanf - by GranaT3 - 03.11.2015, 11:35
Respuesta: Optional enumerators - sscanf - by GranaT3 - 03.11.2015, 22:01

Forum Jump:


Users browsing this thread: 2 Guest(s)