fputs 向文本写数据

#include<iostream>
#include<cstdio>
#include<algorithm>

#pragma warning(disable : 4996)

using namespace std;

int main() {
    
    char str[1000] = "123hello allen C语言";
    FILE *fp = fopen("out.txt", "w");
    fputs(str,fp);
    
    fclose(fp);


    return 0;
}

posted @ 2022-03-16 14:16  江南王小帅  阅读(43)  评论(0)    收藏  举报