const int MAX_SIZE = 5;
// サイズを指定する場合
string fruits[MAX_SIZE] = {"apple", "banana", "lemon"};
// サイズを指定しない場合
string fruits[] = {"apple", "banana", "lemon"}
// 配列の配列(二次元配列)の場合
const int ROW = 3;
const int COL = 4; // ROW == COL である必要は無い
int map[ROW][COL] = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12} };
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme