C++二维数组问题
迷茫
迷茫 2017-04-17 11:48:38
0
2
320

int a[][2]={1,{3,4},5};
书上说这个是错的 请问错在哪啊。。
我用codeBlocks编译之后 报错
error: braces around scalar initializer for type 'int'|

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous(2)
PHPzhong

题主可以写成这样:

int a [][2] = {
    {1},
    {3, 4},
    {6}
}
左手右手慢动作

int a[][2]={{3},{3,4},{6}}

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!