简体   繁体   中英

How to declare an array of bools in C++?

bool people[30][6];
for(int i = 0; i < 30; i++)
    for(int j = 0; j < 6; j++)
        people[i][j] = true;

what are the values of people[29][0] , people[29][1] ? Is it true , false or NULL ?

people[30][1],people[30][2]是未定义的值-30超出了数组的声明范围(最大值为29)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM