-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
71 lines (64 loc) · 1.42 KB
/
Copy pathmain.cpp
File metadata and controls
71 lines (64 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include"main.h"
#include"working.h"
#include<iostream>
void trans(string *s)
{
if(s[0]=="select")
wselect(s);
else if(s[0]=="insert")
winsert(s);
else if(s[0]=="update")
wupdate(s);
else if(s[0]=="delete")
wdelete(s);
else if(s[0]=="create")
wcreate(s);
else if(s[0]=="drop")
wdrop(s);
else
cout<<"Error"<<endl;
}
int main()
{
string s[60];
int i,t,j;
while(1)
{
i=0;
while(cin>>s[i])
{
t=s[i].size()-1;
if(s[i][t]==59) break;
if(s[i]=="exit_sql") {t=-1;break;}
if(s[i]=="look_sql") { look();t=-2;break;}
i++;
}
if(t==-1) break;
/***************************************************************
ifstream fp; //
int number,lenth,i=0;
char a;
string ta_name;
fp.open("E:\\MyProjects\\DBMS\\date\\date.mysql",ios::binary); //
//fp.seekg(ex,ios::beg);
string z[10];
fp>>a;
fp>>ta_name; //
fp>>lenth;
fp>>number;
while(i<2){ fp.read((char *)(z+i),sizeof(string)); i++;} //
fp.close();
for( j=0;j<number*lenth;j++) //
{
cout<<z[j]<<" ";
}
/***************************************************************/
if(t!=-2) trans(s);
t=i;
for(j=0;j<t;j++)
{
for(i=0;s[j][i]!=NULL;i++) s[j][i]=NULL;
}
}
return 0;
}