llu not working in fscanf ??

Asked by Will Smith

given text input from file as:

020,0xf123456abaff123a, ...

fscanf(pat," %llu%*[ ,\n]",&conv); // should convert decimal, octal, or hex notation, but this is not the case...chokes on 'x'

using %llx does convert hex, but converts everything else as hex too (which is not the desired behavior).

(some of the *[ ... notation to discard commas and white space may not be optimized)

is this a bug?

Question information

English Edit question
Ubuntu glibc Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

If you suspect a bug, you should report one

Revision history for this message
Warren Hill (warren-hill) said :

Assuming your programming in C

Not a bug look here


%llu is a 64-bit unsigned (assumes input is decimal)

%d is signed int also does not convert

%i is signed int does convert.

Try asking in a C programmers forum

Can you help with this problem?

Provide an answer of your own, or ask Will Smith for more information if necessary.

To post a message you must log in.