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

  • 大小: 3KB
    文件類型: .c
    金幣: 1
    下載: 1 次
    發布日期: 2021-05-16
  • 語言: C/C++
  • 標簽: 電子詞典??

資源簡介

一個txt文檔的詞庫,c寫的一個電子詞典程序

資源截圖

代碼片段和文件信息

#include?
#include?
#include?

struct?word
{
char*?english;
char*?chinese;
int?flag;
struct?word*?next;
};

void?user_error(char*?src)
{
printf(“%s\n“src);
exit(-1);
}

struct?word*?init(void)
{
struct?word*?ptr?=?(struct?word*)malloc(sizeof(struct?word));
if(NULL==ptr)
{
user_error(“ptr?error“);
}
memset(ptr0sizeof(struct?word));
}

struct?word?listword(struct?word*?tstFILE*?txt)
{
if(tst==NULL?&&?txt==NULL)
{
user_error(“listword?error“);
}
int?ret;
int?out=-1;
int?etr=0;
char?tmp[1];
char*?arr?=?(char*)malloc(1024*sizeof(char));?
char*?name=?(char*)malloc(100*sizeof(char));?

struct?word*ptr?=(struct?word*)malloc(sizeof(struct?word));
if(ptr==NULL)
{
user_error(“ptr?error“);
}

ret?=?fread(namesizeof(char)1txt);
while(1)
{
out++;
fread(name+outsizeof(char)1txt);
if(name[out]==‘\n‘)
{
fread(arrsizeof(char)6txt);
while(1)
{
fread(arr+etrsizeof(char)1txt);
if(arr[etr]==‘\n‘)
{
ret?=?fread(tmpsizeof(char)1txt);
ptr->flag?=?ret;
break;
}
etr++;
}
ptr->chinese=?arr;
goto?loop;
}
}
loop:?fseek(txt-1SEEK_CUR);
??ptr->english=?name;
??return?*ptr;
}

void?creat(struct?word*?pheadstruct?word*?list)
{
if(phead==NULL?||?list==NULL)
{
user_error(“creat?error“);
}
struct?word*?one?=?phead;
struct?word*?second?=?list;
struct?word*?three?=?one->next;?
struct?word*?tmp?=?(struct?word*)malloc(sizeof(struct?word));
if(tmp?==?NULL)
{
user_err

評論

共有 條評論