[問題] 傳遞結構指標給函式發生runtime error
使用gcc編譯
編譯會過,但run time error
struct xxx{
int x;
int y;
}
void fxxx(struct xxx *t){
int i, j;
for(j = 0; j < somenum; j++){
t++;
for(i = 0; i < somenum; i++)
if(i > t->x) t->x = i;
}
}
int
main(){
struct xxx p[100];
fxxx(p);
return 0;
}
compile 會過 但是run time error
不太清楚是哪邊有問題
有請前輩解惑
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 39.14.118.158
→
12/02 11:22, , 1F
12/02 11:22, 1F
→
12/02 11:23, , 2F
12/02 11:23, 2F
→
12/02 14:54, , 3F
12/02 14:54, 3F
→
12/02 15:06, , 4F
12/02 15:06, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章