0
當運行此代碼時,我的代碼錯誤:棧變量window_text_hex
損壞。我看不到錯誤?堆棧周圍變量損壞
DWORD WINAPI fill_matrix(LPVOID lpParameter)
{
char window_text_hex[5];
for (int i = 0; i < 8; i++){
int data_j = 0;
for (int j = 0; j <8; j++)
{
char window_text[5] = { mySerial.data[i][data_j], mySerial.data[i][data_j + 1], mySerial.data[i][data_j + 2], mySerial.data[i][data_j + 3], '\0' };
for (int i = 0; i<4; i++)
{
sprintf(&window_text_hex[i], "%02X", window_text[i]);
}
SetWindowTextA(hWndLabel[i * 8 + j], window_text_hex);
data_j += 4;
}
}
return 0;
}
mySerial.data是[8] [36]