c语言函数不合法怎么改,在线等..VC库函数不能调用/怎么修改

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

VC6.0编译时不能调用mem.h 怎么处理//

代码...

#include "stdio.h" /*I/O函数*/

#include "stdlib.h" /*其它说明*/

#include "string.h" /*字符串函数*/

#include "conio.h" /*屏幕操作函数*/

#include "mem.h" /*内存操作函数*/

#include "ctype.h" /*字符操作函数*/

#include "alloc.h" /*动态地址分配函数*/

struct score /*结构体score*/

{

int mingci;

char xuehao[8];

char mingzi[20];

char nianling[3];

float score[6];

}data,info[1000];

int i,j,k=0;

char temp[20],ch;

FILE *fp,*fp1;

void shuru()

{

if((fp=fopen("s_score.txt","ab+"))==NULL) /*以读写方式打开名为s_score的文件*/

{

printf("cannot open this file.\n");

getch();exit(0);

}

for(i=0;i<=1000;i++)

{

printf("\nPlease shuru xuehao:");

gets(data.xuehao);

printf("Please shuru mingzi:");

gets(data.mingzi);

printf("please shuru nianling:");

gets(data.nianling);

printf("Please shuru shuxue score:");

gets(temp);data.score[0]=atof(temp);

printf("Please input yingyu score:");

gets(temp);data.score[1]=atof(temp);

printf("Please shuru wuli score:");

gets(temp);data.score[2]=atof(temp);

data.score[3]=data.score[0]+data.score[1]+data.score[2];

fwrite(&data,sizeof(data),1,fp);

printf("another?y/n");

ch=getch();

if(ch=='n'||ch=='N')

break;

} fclose(fp); /*读文件结束*/

}

void xianshi()

{

float s;int n;

if((fp=fopen("s_score.txt","rb+"))==NULL)   /*以读写方式打开名为s_score的文件*/

{

printf("Cannot reading this file.\n");   /*先检查打开的操作是否出错*/

exit(0);

}

for(i=0;i<=1000;i++)

{

if((fread(&info[i],sizeof(info[i]),1,fp))!=1) /*检查是否出错*/

break;                                         /*指针 要读写字节数 要读写size字节的数据项 文件型指针*/

}

printf("\nxuehao mingzi nianling shuxue yingyu wuli   zongfen\n");

for(j=0,k=1;j

{

info[j].mingci=k;

printf("%6s %8s %3s %3.1f %3.1f %3.1f %3.1f \n",info[j].xuehao,info[j].mingzi,info[j].nianling,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3]);

}

getch();

fclose(fp);

}

void xiugai()

{

if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL) /*检查是否出错*/

{

printf("Cannot open this file.\n");

exit(0);

}

printf("\nPLease shuru xiugai xuehao:");

scanf("%d",&i); getchar();

while((fread(&data,sizeof(data),1,fp))==1)

{

j=atoi(data.xuehao);

if(j==i)

{

printf("xuehao:%s\nmingzi:%s\nnianling:%s\n",data.xuehao,data.mingzi,data.nianling);

printf("Please shuru mingzi:");

gets(data.mingzi);

printf("Please shuru shuxue score:");

gets(temp);data.score[0]=atof(temp);

printf("Please input yingyu score:");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值