亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

您好,為什么結構體指針已經定義了 ,但是卻提示說沒有定義?怎么回事呢?

您好,為什么結構體指針已經定義了 ,但是卻提示說沒有定義?怎么回事呢?

米脂 2022-01-07 21:07:16
int acsmSearch (STATEMACHINE * acsm, char *Tx,int n,int nline){char *T,*Tc;int index;T=Tx;Tc=Tx+n;STATE *s;ACSM_PATTERN *mlist;for (s=acsm->aStateMachine; T < Tc; T++){s = s.aNextState[*T];if( s.MatchList != NULL ){for( mlist=s.MatchList; mlist!=NULL;mlist=mlist->next ){index = T - mlist->num + 1 - Tx;// PrintMatch (mlist,nline,index);fprintf (stdout, "Match KeyWord %s at %d line %d char\n", mlist->pattern,nline,index);}}}return 0;void acsmFree(STATEMACHINE * acsm) //free the momery{ int flag,i=0;STATE * s;s=acsm->aStateMachine;ACSM_PATTERN * mlist, *ilist;for(i=0;i<ALPHABET_SIZE;i++){if(s->aNextState[i]!=ACSM_FAIL_STATE){}哪位高人幫我指點一下 編譯的錯誤為error C2275: 'STATE' : illegal use of this type as an expressiond:\klf\acsm.h(32) : see declaration of 'STATE'error C2065: 's' : undeclared identifiererror C2275: 'ACSM_PATTERN' : illegal use of this type as an expressionsee declaration of 'ACSM_PATTERN'error C2065: 'mlist' : undeclared identifierwarning C4047: '=' : 'int ' differs in levels of indirection from 'struct _state *'error C2224: left of '.aNextState' must have struct/union typeerror C2224: left of '.MatchList' must have struct/union typeerror C2224: left of '.MatchList' must have struct/union typewarning C4047: '!=' : 'int ' differs in levels of indirection from 'void *'error C2223: left of '->next' must point to struct/unionerror C2223: left of '->num' must point to struct/unionerror C2223: left of '->pattern' must point to struct/unionerror C2275: 'ACSM_PATTERN' : illegal use of this type as an expressionsee declaration of 'ACSM_PATTERN'error C2065: 'ilist' : undeclared identifiererror C2100: illegal indirectionwarning C4047: '=' : 'int ' differs in levels of indirection from 'struct _pattern *'error C2223: left of '->nextpattern' must point to struct/unionerror C2100: illegal indirectionwarning C4022: 'AC_FREE' : pointer mismatch for actual parameter 1在頭文件中 我已經定義了 結構體 并且在正文中 把頭文件也包括進去了 前面的程序段 我也有沿用 為什么 到下面就出問題了?
查看完整描述

2 回答

?
月關寶盒

TA貢獻1772條經驗 獲得超5個贊

在變量聲明之前不要有其他的語句。
char *T,*Tc;
int index;
STATE *s;
ACSM_PATTERN *mlist;
T=Tx;
Tc=Tx+n;

查看完整回答
反對 回復 2022-01-10
?
Qyouu

TA貢獻1786條經驗 獲得超11個贊

STATE *s 換 STATE s 試試
或者所有s.換s->
總之就是.和->的問題

查看完整回答
反對 回復 2022-01-10
  • 2 回答
  • 0 關注
  • 423 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號