About 31,300,000 results
Open links in new tab
  1. printf - How do I print the percent sign (%) in C? - Stack Overflow

    It would be unlikely for both the \ and the % to make it through to printf, even if printf were prepared to treat the \ specially. So the reason why one must type printf("%%"); to print a single % is that's what …

  2. What is the difference between printf () and puts () in C?

    Mar 16, 2010 · the printf () function is used to print both strings and variables to the screen while the puts () function only permits you to print a string only to your screen.

  3. How to correctly printf strings and characters with %s and %c

    How to correctly printf strings and characters with %s and %c Asked 14 years, 2 months ago Modified 2 years, 3 months ago Viewed 789k times

  4. What's the difference between printf and printf_s?

    Apr 11, 2019 · Any argument to printf_s corresponding to a %s specifier shall not be a null pointer. 3 If there is a runtime-constraint violation, the printf_s function does not attempt to produce further …

  5. How to escape the % (percent) sign in C's printf - Stack Overflow

    Dec 7, 2009 · The %, in the printf() (and scanf()) family of functions, starts a conversion specification. One of the rules for conversion specification states that a % as a conversion specifier (immediately …

  6. Correct format specifier for double in printf - Stack Overflow

    20 Format %lf is a perfectly correct printf format for double, exactly as you used it. There's nothing wrong with your code. Format %lf in printf was not supported in old (pre-C99) versions of C …

  7. 'printf' vs. 'cout' in C++ - Stack Overflow

    May 20, 2010 · Origin: printf(): Part of the C standard library, usable in both C and C++. cout: Part of the C++ standard library, specific to C++. Type Safety: printf(): Relies on format specifiers (%d for …

  8. c++ - Best way to safely printf to a string? - Stack Overflow

    Does anyone know a good safe way to redirect the output of a printf-style function to a string? The obvious ways result in buffer overflows. Something like: string s; output.beginRedirect( s ); //

  9. c - What does "%.*s" mean in printf? - Stack Overflow

    Nov 30, 2019 · This question is similar to: What does this statement mean ? printf (" [%.*s] ", (int) lengths [i],. If you believe it’s different, please edit the question, make it clear how it’s different and/or …

  10. c++ - How to use printf with std::string - Stack Overflow

    Printf is actually pretty good to use if size matters. Meaning if you are running a program where memory is an issue, then printf is actually a very good and under rater solution.