C语言超市管理系统UI界面

以下是部分代码。需要源码的私信

#include<easyx.h>
#include<stdio.h>
#include<stdlib.h>


#define width 1280
#define height 840
#define font_w 35  //字体宽度
#define font_h 90  //字体高度

typedef struct node
{
	char name[100];//名字
	char number[100];//编号
	char classify[100];//分类
	int price;//进价
	int sales;//售价
	int repertory;//库存
	int extant;///现存
	node* nxet;
}Lnode, * Hnode;
Lnode L;//创建头结点//用于历史记录
typedef struct anode
{
	char name[100];
	char number[100];
	char classify[100];
	int price;
	int sales;
	int repertory;
	int extant;
}ARRnode;

ARRnode ArrList[1000];
int count_goods = 0;//全局变量--统计商品的多少

int InitList(Lnode& L)     //初始化链表
{
	L.nxet = NULL;    //创建一个头结点
	return 0;
}

int history_count = 0;//用于判断是否有历史记录
int history_goods_Lnode(Lnode& L)//将history中的数据读入到链表中
{
	FILE* fp = fopen("./history.txt", "r");
	if (!fp)
	{
		printf("读取history失败\n");
		return 0;
	}
	Lnode* p, * q;
	p = &L;
	
	q = (Lnode*)malloc(sizeof(Lnode));
	if (!q)
	{
		printf("q--malloc失败\n");
		return 0;
	}
	while (fscanf(fp, "%s%s%s%d%d%d%d", q->name, q->number, q->classify, &q->price, &q->sales, &q->repertory, &q->extant) != EOF)
	{  
		history_count++;//记录链表中的数据数
		p->nxet = q;
		p = q;
		q = (Lnode*)malloc(sizeof(Lnode));
		if (!q)
		{
			printf("q--malloc失败\n");
			return 0;
		}
	}
	p->nxet = NULL;
	printf("history_count=%d\n", history_count);
	fclose(fp);
	return 0;
}

相关推荐

  1. C语言实战系列二:简单超市收银系统

    2024-07-20 19:26:01       51 阅读
  2. C语言 超市商品(Goods) 销售 (Stock) 信息管理软件

    2024-07-20 19:26:01       27 阅读
  3. Python超市商品管理系统

    2024-07-20 19:26:01       35 阅读
  4. C语言】学生管理系统

    2024-07-20 19:26:01       42 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-20 19:26:01       52 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-20 19:26:01       54 阅读
  3. 在Django里面运行非项目文件

    2024-07-20 19:26:01       45 阅读
  4. Python语言-面向对象

    2024-07-20 19:26:01       55 阅读

热门阅读

  1. 在Spring Boot中实现文件上传与管理

    2024-07-20 19:26:01       18 阅读
  2. 掌握Perl中的异常处理:自定义错误管理的艺术

    2024-07-20 19:26:01       15 阅读
  3. Emacs

    2024-07-20 19:26:01       20 阅读
  4. 可再生能源工厂系统 (REPS) - 项目源码

    2024-07-20 19:26:01       18 阅读
  5. Python __init__与__new__的区别

    2024-07-20 19:26:01       13 阅读
  6. 深入探索Perl中的函数定义与调用机制

    2024-07-20 19:26:01       19 阅读
  7. lua语法思维导图

    2024-07-20 19:26:01       11 阅读
  8. Perl脚本的魔法:打造自定义文件系统视图

    2024-07-20 19:26:01       19 阅读