struct champion chm2[20];
struct champion temp;
for (int i = 0; i < 19; i++)
{
for (int j = i + 1; j = 20; j++)
{
if (chm2[i].hp < chm2[j].hp)
{
memcpy(&temp, &chm2[j], sizeof(struct champion));
memcpy(&chm2[j], &chm2[i], sizeof(struct champion));
memcpy(&chm2[i], &temp, sizeof(struct champion));
}
}
}
구조체 배열을 복사하고 싶은데 안되네요.
(chm2에 전부 내용이 들어있습니다. temp는 비어있습니다.)