-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
The argument has type 'unsigned long'
22.06.14 16:00 작성 조회수 749
0
안녕하세요!
맥 터미널로 공부하고 있는 학생입니다!
다름이 아니라 sizeof 연산자 사용 부분에서
printf("%u", sizeof(unsigned int)); 를 출력하면
format specifies type 'unsigned int' but the argument has type 'unsigned long'라는 오류 메시지가 뜹니다!
바쁘시겠지만 잘부탁드리겠습니다!
답변을 작성해보세요.
1
강민철
2022.06.15
안녕하세요 :)
찾아보네,
맥에서 사용하는 컴파일러(VCC)에서는
sizeof 연산자의 리턴값이 unsigned long이기 때문이라고 하네요!
%u가 아닌 %lu로 출력해보세요 :)
참고
https://velog.io/@khh180cm/C-sizeof-warning-%EC%97%90%EB%9F%AC
답변 1