c语言error type,求助:error C2059: syntax error : 'type'

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

在后面temp=fwrite(temp,struct book *temp,1,fp);   //就过不去了

#include "stdio.h"

#include "stdlib.h"

#include "string.h"

#include "stdlib.h"

#include "malloc.h"

struct book

{

char num[20];      //书号

char name[10];     //书名

int jinjia;           //进价

int shoujia;       //售价

int shuliang;      //库存数量

int shouchu;       //售出

struct book *next;

};

struct book *creat(struct book*head)//创建

{

struct book *p1,*p2;

p1=p2=(struct book*)malloc(sizeof(struct book));

printf("*************************\n");

printf("\t请输入书号\n");

printf("*************************\n");

scanf("%s",&p1->num);

if(atoi(p1->num)<0)

exit(0);

system("cls");

printf("*************************\n");

printf("请输入书号为%s的书名\n",p1->num);

printf("*************************\n");

scanf("%s",&p1->name);

system("cls");

printf("*****************************\n");

printf("请输入书号为%s的进书的数量\n",p1->num);

printf("*****************************\n");

scanf("%d",&p1->shuliang);

system("cls");

printf("*************************\n");

printf("请输入书号为%s的进价\n",p1->num);

printf("*************************\n",p1->num);

scanf("%d",&p1->jinjia);

system("cls");

printf("*************************\n");

printf("请输入书号为%s的售价\n",p1->num);

printf("*************************\n",p1->num);

scanf("%d",&p1->shoujia);

system("cls");

p1->next=NULL;

while(atoi(p1->num)>0)

{

if(head==NULL)

head=p1;

else

p2->next=p1;

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值