|
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char str[100], tmp[100];
int a[2][3] = { {100, 200, 300} , {400, 500, 600} };
for (int i = 0; i < 2; i++)
{
strcpy(str, "");
for (int j =0; j < 3; j++)
{
strcpy(tmp, "");
sprintf(tmp, "a[%d][%d] = %d \0", i, j, a[i][j]);
strcat(str, tmp);
}
Memo1->Lines->AddLine(str);
}
}
테스트해보지는 않았지만 되리라 봅니다.
함수명 같은 건 틀릴 수도 있으니 잘 알아서 대처하세요.
|