scanf dla short int & double

0

mian(){
short int a;
double b;
scanf("%?", &a);
scanf("%?", &b);
}

Mam problem z tymi dwoma typami, co powinno być w miejscu ? żeby było poprawnie?

0

no nie wierzę, wybacz, ale: http://lmgtfy.com/?q=scanf i pierwszy link
pierwsza tabelka, trzeci wiersz:

%[*][width][modifiers]type
modifiers: Specifies a size different from int (in the case of d, i and n), unsigned int (in the case of o, u and x) or float (in the case of e, f and g) for the data pointed by the corresponding additional argument:
h : short int (for d, i and n), or unsigned short int (for o, u and x)
l : long int (for d, i and n), or unsigned long int (for o, u and x), or double (for e, f and g)
L : long double (for e, f and g)

Jeżeli to Ci nic nie mówi, to dalej będzie tylko ciężej, ale skoro to jest dział newbie:

scanf("%hd", &a);
scanf("%lf", &b);
0

lol dzięki:D tego nie znałem:D i co najważniejsze działa!

1 użytkowników online, w tym zalogowanych: 0, gości: 1