#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
질문 :
1> BOOL 가기 1 비트 후 (BOOL) 1 바이트를 sizeof를 왜?
2 내가 할당 할 때 BOOL 다음 1 바이트를 가지고> 경우 [1] = 3은 왜이 1 인쇄?
3> 만 [1]의 값 (3)을 출력하는 이유 b를 다음 저장소로 1 & O 값을 고려하는 경우 BOOL?
, 바이트는 저장 메모리에 될 것'00000001' 또는 1'11111111'? – kAmol
"모든 것이 적어도 1 바이트입니다."-> 구조의 필드는 어떻습니까? – chux