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

前端 未结 10 2099
长发绾君心
长发绾君心 2020-12-07 07:27

I know you can print with printf() and puts(). I can also see that printf() allows you to interpolate variables and do formatting.

10条回答
  •  死守一世寂寞
    2020-12-07 08:00

    Right, printf could be thought of as a more powerful version of puts. printf provides the ability to format variables for output using format specifiers such as %s, %d, %lf, etc...

提交回复
热议问题