|
|
霸气的沙滩裤 · 在 Amazon DocumentDB ...· 6 月前 · |
|
|
谈吐大方的甘蔗 · 崔永元赴美调查转基因 ...· 8 月前 · |
|
|
发呆的地瓜 · 天猫精灵投影仪评测:你的随身电影院?_百科TA说· 9 月前 · |
|
|
沉着的沙滩裤 · 北京大学-云南白药国际医学研究中心· 10 月前 · |
|
|
苦闷的黄豆 · 维修外墙玻璃缆绳突发故障工人雨中被困 ...· 1 年前 · |
sprintf stands for “String print”. Instead of printing on console, it store output on char buffer which are specified in sprintf.
sprintf
(buffer,
"Sum of %d and %d is %d"
, a, b, c);
// The string "sum of 10 and 20 is 30" is stored
// into buffer instead of printing on stdout
printf
(
"%s"
, buffer);
return
0;
Sum of 10 and 20 is 30
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Time Complexity: O(n)
, where n is the number of elements being stored in buffer.
Auxiliary Space: O(n)
, where n is the number of elements being stored in buffer.
Solve DSA problems on GfG Practice.