Formatting write file function and use instance in C language

xiaoxiao2021-03-06  85

#include

MAIN () {

File * PTR;

Char line [256];

/ * ... Open a file for output. * /

PTR = fopen ("/ tmp / outputfile", "w");

While (gets (line) / * get data from stdin * / {fprintf (PTR, "% s / n", line); / * send data to file. * /}

Fclose (PTR);

转载请注明原文地址:https://www.9cbs.com/read-95913.html

New Post(0)