简体   繁体   中英

How to print a formatting character out?

How to print the formatting characters such as: %p out? A backslash doesn't do any good as it does with quotations( "" ). I tried it in a simple toy program and I suppose the value returned by it was garbage :
在此处输入图片说明

What I was trying to print was the statement :

With the formatting character %p and '&'

使用双百分比,即%%将为您打印单个%

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

include

int main(){

/* code */

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

}

Should print the proper string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM