由于某些原因,我需要一个指向空的文件指针(FILE*)。这意味着我可以将其传递给fprintf函数,并且fprintf会忽略该文件指针。
例如:
void my_function()
{
FILE* nothing = NULL; // NULL is not correct.
int n = fprintf(nothing, "PI = %f", 3.14); // Note: When nothing = NULL, error ocured.
}
有没有一个指向空的文件指针(FILE*)?
stdout
。 - Adam M-Wsprintf
呢? - littleadv%f
占用的字符数(包括小数点后面的位数)。 - littleadv