c语言纠错,在线等!

来源:百度知道 编辑:UC知道 时间:2024/05/25 16:59:04
功能,读入一个txt文件,计算单词数
------------------------------------------
报错如下:
E:\yuxinjie.c(29) : error C2059: syntax error : ']'
E:\yuxinjie.c(40) : error C2059: syntax error : ']'
E:\yuxinjie.c(40) : error C2143: syntax error : missing ';' before ')'
E:\yuxinjie.c(48) : error C2059: syntax error : 'if'
E:\yuxinjie.c(57) : error C2059: syntax error : 'else'
E:\yuxinjie.c(66) : error C2059: syntax error : '}'
E:\yuxinjie.c(113) : warning C4013: 'quicksort' undefined; assuming extern returning int
---------------------------------------------------

// icsLabWorkspace.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct wordbank
{
char word[20];
int num;
};

struct wordbank word[10];

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct wordbank
{
char word[20];
int num;
};

struct wordbank word[10];

char storeChar[20];
int storeInt=0;
int wordbankSize=0;
int judgeInt=0;

void store(char b)
{
storeChar[storeInt]+=b;
storeInt++;
}

void initStore()
{
storeChar[0]=0;
storeInt=0;
}
void putcount(void)
{
int f,y,s;

for (f=0;f<wordbankSize;f++)
{
/*check if the word input equals the word in the word bank*/
judgeInt=0;
for (y=0;y<storeInt;y++)
{
if (word[f].word[y]==storeChar[y])
{
judgeInt++;
}
}
/*in case the same one is found*/
if (judgeInt==storeInt)
{
//if (wordbankSize==word[].length)
{
//expand;//seudocode
}
/*count the word in the relevant struct elems*/
word[f].num++;