I declare a variable for a 64 bit counter as :
long long call_count;
What is the format specifier that I should use in print statements?
I tried, %l
, %ld
, %ll
. None seems to be correct.
I use Diab C compiler for compiling my application code to run on pSOS operating system.
For long double you should use format "%Lf" .
Printing short, long, long long, and unsigned Types To print an unsigned int number, use the %u notation. To print a long value, use the %ld format specifier. You can use the l prefix for x and o, too. So you would use %lx to print a long integer in hexadecimal format and %lo to print in octal format.
In the printf statement when %u is used to print the value of the char c, then the ASCII value of 'a' is printed.
%Lf format specifier for long double %lf and %Lf plays different role in printf. So, we should use %Lf format specifier for printing a long double value.
According to C99, it should be "%lld" (see, for example,here). If Diab C isn't C99, then you'd have to look at the compiler docs, which I can't seem to find online with a quick Googling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With