#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
int main(void) {
char ch[] = "test";
bool X[32];
char * pos = (char *)X;
for (int i = 0; i < 4; ++i) {
pos[i] = ch[i];
}
printf("%d\n", X[0]);
return 0;
}
output: 116
There are both int type number that is not 1 or 0 and bool type 'false' in the array.
As the following picture.
VS code debug: enter image description here