在C語言中,靜態數組聲明的技巧有以下幾點:
#define ARRAY_SIZE 10
int array[ARRAY_SIZE];
int array[] = {1, 2, 3, 4, 5};
int size = sizeof(array) / sizeof(array[0]);
int array[] = {1, 2, 3, 4, 5};
int matrix[3][3] = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
const int array[] = {1, 2, 3, 4, 5};