,在第一个参数中使用变量通常是危险的--而且在概念上是错误的。printf: char * myMessage;
// ... myMessage gets filled at runtime with some unpredictable content
printf(myMessage); // WRONG! (what if myMessage contains a '%' char?)
puts(myMessage); // correct
printf("%s\n",myMessage); // equivalent to the above, perhaps less efficient 同样适用于fputsVSfprintf(但fputs不添加换行符)。... 展开详请
你可以这样做: int f(int x)
{
x = 3; //with "const int x" it would be forbidden
// now x doesn't have initial value
// which can be misleading in big functions
}... 展开详请