비트필드 구조체에서요..
통꽃
2023.04.01
질문 제목 : 한개의 unsigned int에 문자4개를 저장하는 것질문 요약 :한개의 unsigned int에 문자 받기..질문 내용 :
int에 char을 못받는건가요? 아니면 비트이동연산을 써서 문자를 받아야하는지..
컴파일하면 되는데
cmd창에서 에러가나서요.. 조금만 조언부탁드려여..
#include stdio.h
struct bit_god
{
unsigned int one_c : 8 ;
unsigned int two_c : 8;
unsigned int three_c : 8;
unsigned int four_c : 8 ;
};
int main (void)
{
struct bit_god a;
printf(첫번째 문자를 입력하세요 : ); scanf( %d ,a.one_c);
printf(두번째 문자를 입력하세요 : ); scanf( %d , a.two_c);
return 0;
}