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");
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.