- Mystery with bool data type
- #include <stdio.h>
- #include <stdbool.h>
- int main()
- {
- bool a[5]={0,1,0,0,0};
- a[1]=3;
- printf("n bool is %d",a[1]);
- printf("n sizeof bool is %d and size of a is %d",sizeof(bool),sizeof(a));
- bool b[10];
- printf("n bool is %d",b[1]);
- }
- bool is 1
- sizeof bool is 1 and size of a is 5
- bool is 4