⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compare.c

📁 一个用C编写的简单的关系数据库系统
💻 C
字号:
int Compare(RecUnion * x, RecUnion * y, int typeX, int typeY)
{
	if (typeX != typeY)
	{
		puts("	输入条件错误,类型不符,不能进行比较");
		return ERROR;
	}
	switch (typeX) {
	case Int:
		if (x->intType - y->intType == 0)
			return EQ;
		else if (x->intType - y->intType > 0)
			return GT;
		else
			return LT;
	case Float:
		if ((x->floatType - y->floatType <= 0.00001) && (x->floatType - y->floatType >= -0.00001))
			return EQ;
		else if (x->floatType - y->floatType > 0.00001)
			return GT;
		else
			return LT;
	case String:
		if (strcmpi(x->string, y->string) == 0)
			return EQ;
		else if (strcmpi(x->string, y->string) > 0)
			return GT;
		else 
			return LT;
	}
	return ERROR;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -