Print "A" presented in HEX (printf("\0x41"))

c

Solution

Drop the leading 0 in the hexadecimal character literal:

printf("\x41");

Integer literals use `0x` prefix, characters use `\x`.

You might also want to add a linefeed to make sure it appears:

printf("\x41\n");

You can of course also print a single character:

printf("%c\n", 0x41);

or portably:

printf("%c\n", 'a');

Problem

How to make `printf("\0x41")`; to rint 'A' letter. I know, that `\0` means end of line, but how to deal when I need to print character presented in `HEX`?

Original source