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

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

出現Error executing xicl6.exe.?為什么會這樣?

出現Error executing xicl6.exe.?為什么會這樣?

千萬里不及你 2022-05-13 14:11:34
#include<stdio.h>#include<string.h>#include<stdlib.h>struct boom{int x;char y[10];};void B(boom &T);void main(){boom T[10];for(int i=0;i<10;i++){scanf("%d %s",&T[i].x,T[i].y);printf("%d %s\n",T[i].x,T[i].y);}B(T[10]);}void B(boom &T){boom T1;scanf("%d %s",&T1.x,T1.y);for(int i=0;i<10;i++){if(strcmp(T[i].y,T1.y)==0){printf("hhhhh\n");exit(0);}}}C:\Documents and Settings\Administrator\桌面\Text1.cpp(26) : error C2676: binary '[' : 'struct boom' does not define this operator or a conversion to a type acceptable to the predefined operatorC:\Documents and Settings\Administrator\桌面\Text1.cpp(26) : error C2228: left of '.y' must have class/struct/union typeError executing xicl6.exe.
查看完整描述

2 回答

?
隔江千里

TA貢獻1906條經驗 獲得超10個贊

void B(boom &T),這個函數期望參數是一個boom引用,而你傳入的是一個級數頭指針。

查看完整回答
反對 回復 2022-05-16
?
慕沐林林

TA貢獻2016條經驗 獲得超9個贊

試試 把 &T[i].y 改成 &((T[i]).y)

查看完整回答
反對 回復 2022-05-16
  • 2 回答
  • 0 關注
  • 178 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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