create.c

来自「一个c语言开发的小型的dbms系统」· C语言 代码 · 共 35 行

C
35
字号
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "struct.h"

void create(struct	_createstruct *cs)
{
	char  table[10];
	char fields[10][30];
	int col_type[10],col_lenth[100],number;
	int i=0;
	struct	_createfieldsdef *field;
	 strcpy(table,cs->table);
	field=cs->fdef;
	while (field!=NULL)
		{
			strcpy(&fields[i],field->field);
			col_type[i]=atoi(field->type);
			col_lenth[i]=atoi(field->length);
			i=i+1;
			field=field->next_fdef;
		}
	number=i;
	create_table(&table,&fields,&col_type,&col_lenth,number);
}

void drop(struct	_dropstruct *drs)
{
	char  table[10]; 
	strcpy(table,drs->table);
	drop_table(&table);
}

⌨️ 快捷键说明

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