views:

53

answers:

2

Is there any other (alternative) format specifiers for long long in C other than %lld which can be safely used in scanf under gcc?

I am aware that %lld does it's job fine; I am just inquisitive :-)

+1  A: 

you can use %I64d... but it MS specific...

mihirpmehta
+1  A: 

From C99, "ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a long long int or unsigned long long int argument; or that a following n conversion specifier applies to a pointer to a long long int argument." So you can use "%lld" to specify long long datatype.

kumar
Are you sure "%ll" can be used safely ?
Zammy
Sorry, you need to use %ll with any of d, i, o, u, x, or X conversion specifier, so "%lld" is correct.
kumar