#3
by Jaku » 6年前
返信ありがとうございます。
みけCATさんのご指摘通り、zahyoの要素数を増やしDxLib_Initを書き加えたら正常に動作しました!
一応コードを貼っておきます。
コード:
#include "DxLib.h"
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) {
ChangeWindowMode(TRUE);
DxLib_Init();
struct XY {
int x;
int y;
};
int i;
int Green = GetColor(0, 255, 0);
int x = 200, y = 200;
XY zahyo[3];
for (i = 0; i < 3; i++) {
zahyo[i] = { GetRand(100),GetRand(100) };
DrawFormatString(x,y,Green,"%d,%d\n", zahyo[i].x, zahyo[i].y);
y += 20;
}
WaitKey();
DxLib_End();
return 0;
}
返信ありがとうございます。
みけCATさんのご指摘通り、zahyoの要素数を増やしDxLib_Initを書き加えたら正常に動作しました!
一応コードを貼っておきます。
[code]
#include "DxLib.h"
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) {
ChangeWindowMode(TRUE);
DxLib_Init();
struct XY {
int x;
int y;
};
int i;
int Green = GetColor(0, 255, 0);
int x = 200, y = 200;
XY zahyo[3];
for (i = 0; i < 3; i++) {
zahyo[i] = { GetRand(100),GetRand(100) };
DrawFormatString(x,y,Green,"%d,%d\n", zahyo[i].x, zahyo[i].y);
y += 20;
}
WaitKey();
DxLib_End();
return 0;
}
[/code]