プロが教えるわが家の防犯対策術!

辞書検索プログラムが実行できません。どこがおかしいか教えてください。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUCKET_SIZE 100
typedef struct pointer
{
struct cell *chain;
}pointer;

struct cell{
char eng[20];
char jp[40];
struct cell *next;
} table[BUCKET_SIZE];

int n;
void read_dic();
void init_table();
int hash(char *tango);
void main();
struct cell *find(char *tango);
struct pointer bucket[BUCKET_SIZE];

void init_table()
{
int i;

for (i=0;i<BUCKET_SIZE;i++){
strcpy(table[i].eng,"0");
strcpy(table[i].jp,"0"); }

}

void main()
{
int m;
struct cell *p;
char tango[20];

read_dic();

while(1){
printf("\n単語を入力: ");
scanf("%s", tango);

if (strcmp(tango, "*") == 0){
printf("検索を終了\n");
exit(0);
}


if((p= find(tango)) == NULL)
printf("単語は見つかりませんでした\n");
else
printf("訳語: %s \n", table[p].jp);
}
}


まだ続きます。。。

A 回答 (1件)

管理者より:


続きの質問があるのでそちらをご参照下さい

参考URL:http://www.okweb.ne.jp/kotaeru.php3?q=109206
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!