-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2번
More file actions
30 lines (25 loc) · 2.27 KB
/
2번
File metadata and controls
30 lines (25 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
int main()
{
char charType; // char 형 변수 선언
int integerType; // int 형 변수 선언
float floatType; // float 형 변수 선언
double doubleType; // double 형 변수 선언
printf("Size of char: %ld byte\n",sizeof(charType)); // 선언한 char형 변수의 크기를 출력한다.
printf("Size of int: %ld bytes\n",sizeof(integerType)); // 선언한 int형 변수의 크기를 출력한다.
printf("Size of float: %ld bytes\n",sizeof(floatType)); // 선언한 float형 변수의 크기 출력한다.
printf("Size of double: %ld bytes\n",sizeof(doubleType)); // 선언한 double형 변수의 크기 출력한다.
printf("-----------------------------------------\n");
printf("Size of char: %ld byte\n",sizeof(char)); // 정수 자료형 char의 크기를 출력한다.
printf("Size of int: %ld bytes\n",sizeof(int)); // 정수 자료형 int의 크기를 출력한다.
printf("Size of float: %ld bytes\n",sizeof(float)); // 정수 자료형 float의 크기를 출력한다.
printf("Size of double: %ld bytes\n",sizeof(double)); // 정수 자료형 double의 크기를 출력한다
printf("-----------------------------------------\n");
printf("Size of char*: %ld byte\n",sizeof(char*)); // char형 포인터의 크기를 출력한다. 포인트의 주소크기는 머신의 사용체계에 따라서 값이 다르다.
printf("Size of int*: %ld bytes\n",sizeof(int*)); // int형 포인터의 크기를 출력한다. 포인트의 주소크기은 머신의 사용체계에 따라서 값이 다르다.
printf("Size of float*: %ld bytes\n",sizeof(float*)); // float형 포인터의 크기를 출력한다. 포인트의 주소크기은 머신의 사용체계에 따라서 값이 다르다.
printf("Size of double*: %ld bytes\n",sizeof(double*)); // double형 포인터의 크기를 출력한다. 포인트의 주소크기은 머신의 사용체계에 따라서 값이 다르다.
printf("-----------------------------------------\n");
printf("[----- [ 김윤희 ] [ 2018038014 ] -----]"); // 내 이름과 학번을 출력한다
return 0;
}