構造体の配列を交換しようとしていますが、tempに格納する同様の方法に従うと、次のように機能すると思いました。
int temp ,a, b;
temp = a;
a = b;
b = temp;
私の構造体定義の配列は次のとおりです。
struct storage data[10];
構造体の配列を交換する試みで、これを試しました:
struct storage temp[1];
temp = data[1];
data[1] = data[2];
data[2] = temp;
残念ながら、コンパイルされません
私のエラーは以下の通りです:
エラー#2168:「=」のオペランドには互換性のないタイプ「structstorage[1]」と「structstorage」があります。
エラー#2088:左辺値が必要です。
エラー#2168:「=」のオペランドのタイプは「structstorage」と「structstorage*」に互換性がありません。