- #include
- #include
- #include
- #include
- sqlite3* db = NULL;
- void do_insert(void)
- {
- int id =0;
- int i;
- char word[20]="";
- char sq[70]="";
- char fy[50]="";
- FILE * fd = fopen("./dict.txt","r");
- int index = 0;
- char * res= NULL;
- char sql[100]="";
- char * errmsg = NULL;
- while(1)
- {
-
- id++;
- index =0;
- bzero(word,sizeof(word));
- bzero(fy,sizeof(fy));
- bzero(sql,sizeof(sql));
- res = fgets(sq,sizeof(sql),fd); // 一行行读取数据
- if (NULL == res)
- {
- break;
- }
- while(1)
- {
- printf("%d\n",index);
- if (sq[index]==' '&&sq[index+1]==' ')
- {
- for (i=0;i
- {
- word[i]=sq[i];
- }
-
- strcpy(fy,sq+2+index);
-
- sprintf(sql,"insert into stu values (%d,\