91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

用C語言實現了對數據庫一些基本功能,如建庫、建表、加行、加列、刪行、刪列等的模擬

資源截圖

代碼片段和文件信息

#include??
#include??
#include
#include?
#include
using?namespace?std;?
#define?MAX?128
string?S_TEMP=“0“;

struct?DOC_TEMP
{
string?line;
int?num;
};

struct?Info
{
string?name;
int?num;
};

struct?DOC_TEMP?D_TEMP[10];

char?temp_suo[50];

int?changename(string?s_newname){
char?cmd[MAX];
int?numj=0;
char?oldname[MAX]newname[MAX];
????string?pathtemp;
for(j=0;j<128;j++){
newname[j]=NULL;
}
????num=s_newname.length();
for(j=0;j newname[j]=s_newname[j];
}

struct?_finddata_t?files;
int?File_Handle;
int?i=0;
File_Handle=_findfirst(“e:\\temp.txt“&files);
if(File_Handle==-1){
printf(“error\n“);
return?0;
}
do{
strcpy(oldnamefiles.name);?????????????????
sprintf(cmd“rename?e:\\%s?%s“oldnamenewname);??????????
printf(“%s\n“cmd);
cout<<“biao“;
system(cmd);
i++;
}
while(0==_findnext(File_Handle&files));
_findclose(File_Handle);
printf(“Find?%d?files\n“i);
return?0;
}

void?CreateDatebase()
{
int?i;
string?path;?
string?temp;
string?suo;
for(i=0;i<50;i++)
temp_suo[i]=NULL;

cout<<“請輸入數據庫名稱:“< cin>>temp;

path=“e:\\“+temp;
S_TEMP=path+“\\“;
path=“md?“+path;
system(path.c_str());??
suo=S_TEMP+“suoyin“;
int?m=suo.length();
for(i=0;i temp_suo[i]=suo[i];
ofstream?F_suoyin(temp_suo);
cout<<“datebase?建立完成!“<}

void?CreateTable()
{
cout<<“請輸入表名:“< string?Tname;
string?pname;
string?leixing;
int?I=0;
int?ij;
int?num=0;
int?s_num=0;
char?t=‘y‘;
char?x;
char?name[MAX];
if(S_TEMP==“0“){
cout<<“error“;
}
cin>>Tname;
????
pname=S_TEMP+Tname;
for(j=0;j<128;j++){
name[j]=NULL;
}
????s_num=pname.length();
for(j=0;j name[j]=pname[j];
}
ofstream?Tdfile(name);
????ofstream?suoyin(temp_suo);
suoyin< while(t==‘y‘){
cout<<“請輸入屬性名稱“< cin>>Tname;
cout<<“請輸入屬性類型“< cin>>leixing;
Tdfile< I++;
cout<<“繼續?(y\n)“< cin>>t;
}
t=‘y‘;
Tdfile<<‘\n‘;
Tdfile.close();
ifstream?Tfile(name);
????x=Tfile.get();
cout<<“包含“< while(x!=‘\n‘)
{
if(x!=‘:‘)
{
cout< x=Tfile.get();
}
else?if(x==‘:‘)
{
cout<<““;
x=Tfile.get();
}
}

i=I;
while(t==‘y‘)
{
cout<<“請輸入元組數據“< i=I;
????while(i!=0)
{
???? cout<<“請輸入數據“< ???? cin>>pname;???????????????????????????????????????
???? ofstream?Tdfile1(nameios::app);
???? Tdfile1<<‘?‘< ???? i--;
???? if(i==0)
Tdfile1<<‘\n‘;
}
cout<<“是否繼續添加元組?(y/n)“< cin>>t;
}
}

void?Select()
{
string?DnameTnameAll_name;
char?temp[100];
int?i=0m;
int?MAX_LENGTH?=?100;?
char?line[100];?
for(i=0;i<100;i++)
temp[i]=NULL;
cout<<“請輸入要查找的數據庫:“< cin>>Dname;

cout<<“請輸入要查找的表:“< cin>>Tname;
????All_name=“

評論

共有 條評論