这是C语言中printf函数的标准原型。
int printf(const char *format, ...);
格式字符串由零个或多个指令组成:普通字符(非%), 原样复制到输出流;和转换规范, 每个参数(如果给出的参数太多, 将导致错误)。
字符%后跟以下字符之一。
标志字符
字宽
精度
长度修饰符
转换说明符:
看到http://swoolley.org/man.cgi/3/printf有关上述所有字符的详细信息。标准中要注意的主要内容是有关转换说明符的以下内容。
A `%' is written. No argument is converted. The complete conversion specification is`%%'.
因此我们可以使用” %%”打印”%”
/* Program to print %*/
#include<stdio.h>
/* Program to print %*/
int main()
{
printf ( "%%" );
getchar ();
return 0;
}
我们还可以使用以下命令打印”%”。
printf ( "%c" , '%' );
printf ( "%s" , "%" );
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_39768.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57