- 716 名前:デフォルトの名無しさん mailto:sage [2008/05/06(火) 17:33:03 ]
- #include <stdio.h>
struct histgram{ int x; int y[100]; }; void one(struct histgram *hist); void two(struct histgram *hist); int main (void){ struct histgram hist[1] ; int z; hist->x = 0; for(z=0;z<100;z++){ hist->y[z]=0; } printf("before***%d***%d***%d***",hist->x,hist->y[0],hist->y[50]); one(hist); printf("before***%s***%s***%s***",hist->x,hist->y[0],hist->y[50]); for(z=0;z<9999999999;z++); return 0; } void one(struct histgram *hist) { two(hist); } void two(struct histgram *hist) { int z; hist->x = 1; for(z=0;z<100;z++){ hist->y[z]=1;}} これで実行するとメモリのエラーが出るんですが、どうすれば解決するでしょうか
|

|