Skip to content

Instantly share code, notes, and snippets.

@nattybear
Created June 1, 2017 00:47
Show Gist options
  • Save nattybear/1104c381bdc34c1978ebedd12a6809c8 to your computer and use it in GitHub Desktop.
Save nattybear/1104c381bdc34c1978ebedd12a6809c8 to your computer and use it in GitHub Desktop.
C언어에서 실수형 자료형의 표현
#include <stdio.h>
int main() {
float a = 5.789F;
printf("%d\n", a);
return 0;
}
@nattybear
Copy link
Author

nattybear commented Jun 1, 2017

float.c 코드를 컴파일 시도하면 아래와 같은 에러가 나네

format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’

%d 서식문자는 인자로 실수형만 받을 수 있나보다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment