[Quote=引用 4 楼 huanmie_09 的回复:]
// crt_fprintf.c
/* This program uses fprintf to format various
* data and print it to the file named FPRINTF.OUT. It
* then displays FPRINTF.OUT on the screen using the system
* function to in……
[/Quote]
正解。不过把FILE *变量命名为stream不如f或pF好。
// crt_fprintf.c
/* This program uses fprintf to format various
* data and print it to the file named FPRINTF.OUT. It
* then displays FPRINTF.OUT on the screen using the system
* function to invoke the operating-system TYPE command.
*/
#include <stdio.h>
#include <process.h>
FILE *stream;
int main( void )
{
int i = 10;
double fp = 1.5;
char s[] = "this is a string";
char c = '\n';