以字符的方式写文件
fputc(所要写入的字符,文件指针);
代码演示:
代码语言:javascript复制#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//以字符方式写入文件的操作
void test()
{
char ch[64] = "大忽悠";
FILE* fp = NULL;
fp = fopen("name.txt","w");
int i = 0;;
while (ch[i] != '
fputc(所要写入的字符,文件指针);
代码演示:
代码语言:javascript复制#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//以字符方式写入文件的操作
void test()
{
char ch[64] = "大忽悠";
FILE* fp = NULL;
fp = fopen("name.txt","w");
int i = 0;;
while (ch[i] != '