| What does these mean -
|
| - " lx%08lx "
In a printf call:
- the leading lx will be written literally (as is).
- %08lx will print 8 hexadecimal digits with leading zeroes.
| - " %1024[^\n]%*[^\n] "
This looks like it belongs in a scanf call:
- up to the following 1024 characters that do not match the newline
character will be read into the char buffer passed as a parameter.
All the following character up to the newline character are
discarded.
.... if I'm not mistaken.
| I have seen them being used in printfs.
| When do you exactly write/use these ?
When you are sure that all the potential readers of your code
understand the C format specifiers in depth.
A lot can be done with C format specifiers (and even more than
before in the C99 standard). They allow concise parsing of
input and formatting of output text. But they tend to be
tricky and error prone...
Cheers,