Top "Printf" questions

`printf` is a common function for formatted output.

Using floats with sprintf() in embedded C

Guys, I want to know if float variables can be used in sprintf() function. Like, if we write: sprintf(str,"…

c embedded floating-point printf
The "backspace" escape character '\b': unexpected behavior?

So I'm finally reading through K&R, and I learned something within the first few pages, that there is …

c language-agnostic printf special-characters backspace
How to format strings using printf() to get equal length in the output?

I have two functions, one which produces messages like Starting initialization... and another which checks return codes and outputs "Ok", "…

c string printf pretty-print
Avoid trailing zeroes in printf()

I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able …

c printf
How do I align a number like this in C?

I need to align a series of numbers in C with printf() like this example: -------1 -------5 ------50 -----100 ----1000 …

c printf alignment
Integer ASCII value to character in BASH using printf

Character to value works: $ printf "%d\n" \'A 65 $ I have two questions, the first one is most important: How do …

bash ascii printf
In C can a long printf statement be broken up into multiple lines?

I have the following statement: printf("name: %s\targs: %s\tvalue %d\tarraysize %d\n", sp->name, sp->…

c printf
Using colors with printf

When written like this, it outputs text in blue: printf "\e[1;34mThis is a blue text.\e[0m" But I …

linux bash colors printf
Align printf output in Java

I need to display a list of items with their prices from an array and would like to align the …

java alignment printf text-align