About 2,150,000 results
Open links in new tab
  1. Difference between fprintf, printf and sprintf? - Stack Overflow

    Jan 16, 2015 · The only difference between sprintf () and printf () is that sprintf () writes data into a character array, while printf () writes data to stdout, the standard output device.

  2. c++ - std::string formatting like sprintf - Stack Overflow

    Feb 26, 2010 · I have to format std::string with sprintf and send it into file stream. How can I do this?

  3. c++ - understanding the dangers of sprintf (...) - Stack Overflow

    Sep 8, 2010 · The sprintf function, when used with certain format specifiers, poses two types of security risk: (1) writing memory it shouldn't; (2) reading memory it shouldn't.

  4. c - How to append strings using sprintf? - Stack Overflow

    Feb 17, 2017 · 5 Why do you want to use sprintf for string concatenation when there are methods intended specifically for what you need such as strcat and strncat?

  5. c - How to use "%f" to populate a double value into a string with …

    May 22, 2017 · I am trying to populate a string with a double value using a sprintf like this: sprintf (S, "%f", val); But the precision is being cut off to six decimal places.

  6. Using floats with sprintf() in embedded C - Stack Overflow

    The compiler doesn't try to read the format string and do the cast for you; at runtime, sprintf has no meta-information available to determine what is on the stack; it just pops bytes and …

  7. c - snprintf and sprintf explanation - Stack Overflow

    Directly from the cplusplus Documentation snprintf composes a string with the same text that would be printed if format was used on printf, but instead of being printed, the content is stored …

  8. 'sprintf': double precision in C - Stack Overflow

    From your question it seems like you are using C99, as you have used %lf for double. To achieve the desired output replace: sprintf(aa, "%lf", a); with sprintf(aa, "%0.7f", a); The general syntax …

  9. what do these symbolic strings mean: %02d %01d? - Stack Overflow

    % is a special character you put in format strings, for example in C language printf and scanf (and family), that basically says "this is a placeholder for something else, not to be printed/read …

  10. What is the difference between sprintf_s and snprintf?

    Apr 16, 2023 · The difference between sprintf and snprintf is primarily that snprintf is intended to limit itself to writing into the given array and to return how many bytes are needed to write the …