Top "Format-specifiers" questions

format-specifiers refer to the syntax of the format string parameter of the *printf functions in C/C++, allowing special formatting of arguments.

Why is printf with a single argument (without conversion specifiers) deprecated?

In a book that I'm reading, it's written that printf with a single argument (without conversion specifiers) is deprecated. It …

c security printf format-specifiers puts
Is there a format specifier that works with Boolean values?

I want to do something like this: NSLog(@"You got: %x", booleanValue); where x is the specifier. But I can't …

iphone ios string format-specifiers
what does the % % mean in java?

Im a PHP-programmer and wonder what this line means. System.out.printf("exp(%.3f) is %.3f%n", x, Math.exp(…

java printf format-specifiers
What is the need of hh and h format specifiers?

In the code below mac_str is char pointer and mac is a uint8_t array: sscanf(mac_str,"%x:%…

c scanf format-specifiers
Can I output a Windows handle using %p specifier?

This is a kind of follow-up to this question. Windows SDK features HANDLE datatype that is defined in WinNT.h …

c++ winapi pointers handle format-specifiers
Using %f to print an integer variable

The output of the following c program is: 0.000000 Is there a logic behind the output or is the answer compiler …

c format-specifiers
Is there a format specifier that always means char string with _tprintf?

When you build an app on Windows using TCHAR support, %s in _tprintf() means char * string for Ansi builds and …

windows printf tchar format-specifiers
scanf %u negative number?

I have tried scanf("%u",&number) and I have entered negative number the problem is when I printf("%d",…

c printf scanf unsigned format-specifiers
Escaping square bracket ] in sscanf

I want to scan lines like "[25, 28] => 34" I wrote a small program to test it out: #include <cstdlib> #…

c parsing escaping scanf format-specifiers
Why weren't new (bit width specific) printf() format option strings adoped as part of C99?

While researching how to do cross-platform printf() format strings in C (that is, taking into account the number of bits …

c types printf c99 format-specifiers