求助!!!!C语言高手一个小问题(急在线等!!!)

[复制链接]
查看11 | 回复3 | 2009-6-27 14:30:07 | 显示全部楼层 |阅读模式
#include #include #define SIZE 50void main(){ char str[SIZE] = "the result of last game : computer win"; FILE *fp = fopen("data.txt", "w+"); fputs(str, fp); memset(str, 0, SIZE); rewind(fp); fgets(str, SIZE-1, fp); puts(str); fclose(fp);}...
回复

使用道具 举报

千问 | 2009-6-27 14:30:07 | 显示全部楼层
#includemain(){FILE *fp; char a[100]="the result of last game : computer win",b[100]; fp=fopen("d://www.txt","w"); fprintf(fp,"%s",a); fclose(fp); fp=fopen("...
回复

使用道具 举报

千问 | 2009-6-27 14:30:07 | 显示全部楼层
哦, 对了,用fprintf和fscanf可以实现...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行