初涉數組(bool數組)

初涉數組(bool數組) c語言中bool數組的使用方法: 1.導入 首先要導入stdbool.h頭文件: #include <stdbool.h> 2.聲明 int m = 5; bool flag [m]; 3.初始化 雖然bool類型默認值是0,但是仍要初始化,不初始化會出現以下結果: 即初始值不是0 用for循環遍歷初始化: for (int i = 0; i < m; i ++){   
相關文章
相關標籤/搜索