Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 定义过程中如何在数组中写入值_C - Fatal编程技术网

C 定义过程中如何在数组中写入值

C 定义过程中如何在数组中写入值,c,C,如何在数组定义期间放置值: int array[2][3][4] = {{},{{},{2}}}; 我想将值放入数组[1][1][1]。以上结果是数组[1][1][0]假设为C99,只需使用: int array[2][3][4] = { [1][1][1] = 2 }; 完成。读一本基本的C语言书或使用谷歌。

如何在数组定义期间放置值:

int array[2][3][4] = {{},{{},{2}}};

我想将值放入数组[1][1][1]。以上结果是数组[1][1][0]

假设为C99,只需使用:

int array[2][3][4] = { [1][1][1] = 2 };
完成。

读一本基本的C语言书或使用谷歌。