Top "Printf" questions

`printf` is a common function for formatted output.

Rounding to nearest fraction (half, quarter, etc.)

So, I need to create the following functions but my head can't think of any possibility in PHP without complicated …

php rounding printf floor ceil
'strncpy' vs. 'sprintf'

I can see many sprintf's used in my applications for copying a string. I have a character array: char myarray[10]; …

c printf strncpy
Segmentation fault (core dumped)

I am relatively new on C, I am trying to run a simple program and I get this Error message: …

c segmentation-fault printf coredump
How to fmt.Printf an integer with thousands comma

Does Go's fmt.Printf support outputting a number with the thousands comma? fmt.Printf("%d", 1000) outputs 1000, what format can I …

string go formatting printf
Specifying maximum printf field width for numbers (truncating if necessary)?

You can truncate strings with a printf field-width specifier: printf("%.5s", "abcdefgh"); > abcde Unfortunately it does not work for …

printf truncate format-specifiers
Is the %zu specifier required for printf?

We are using C89 on an embedded platform. I attempted to print out a size_t, but it did not …

c printf c89 size-t c-libraries
printf vs. std::cout

Possible Duplicate: Should I use printf in my C++ code? If I just want to print a string on screen, …

c++ printf cout
What is the correct printf specifier for printing pid_t

I'm currently using a explicit cast to long and using %ld for printing pid_t, is there a specifier such …

c io printf pid
Why doesn't PRIu64 work in this code?

As per this answer, I tried printing a uint64_t, but it gives me an error: error: expected ``)' before …

c++ printf c++03
C complex number and printf

How to print ( with printf ) complex number? For example, if I have this code: #include <stdio.h> #include &…

c printf complex-numbers