水木清华的一个帖子,问问CSDN上的大人们(关于printf函数)
char *p="%s"; printf(p);
#include <stdio.h>int printf(const char *format, ...);
va_list ap;type val;va_start(ap, last);val = (type)va_arg(ap, type); ....va_end(ap);
[解决办法]
只贴标准:
7.19.6.1 The fprintf function
The fprintf function writes output to the stream pointed to by stream, under control
of the string pointed to by format that specifies how subsequent arguments are
converted for output. If there are insufficient arguments for the format, the behavior is
undefined
printf就等价于fprintf