簡體   English   中英

如何打印格式字符?

[英]How to print a formatting character out?

如何打印格式字符,例如: %p out? 反斜杠沒有任何用引號( "" )的好處。 我在一個簡單的玩具程序中嘗試過它,我想它返回的值是垃圾:
在此處輸入圖片說明

我要打印的是以下語句:

With the formatting character %p and '&'

使用雙百分比,即%%將為您打印單個%

printf("With the formatting character %%p and '&'\n");

包括

int main(){

/* code */

printf("%s\n","With the formatting character %p and '&;");

}

應該打印正確的字符串。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM