How do I print the '%' character with 'printf'?

前端 未结 6 700
离开以前
离开以前 2020-12-20 14:58

Simple problem that I can\'t figure out...

How can I print a \'%\' character within a printf string? The code below prints it, but gives an \'invalid co

6条回答
  •  攒了一身酷
    2020-12-20 15:50

    This is a bit tricky because the documentation for the template for printf is actually in the documentation for sprintf. You have to catch that line in the middle of the paragraph to know to look there.

提交回复
热议问题