SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
( ) 

, ,
( ) 

, ,
main memory
( ) 

, ,
main memory
0xFF
( ) 

, ,
main memory
0xFF
( ) 

, ,
main memory
radius
radius
0xFF
( ) 

, ,
main memory
radius
radius500


/ /
1234 0.123 ‘A’
1234 0.123 ‘A’


(Integer type)


(Floating-point type)


(Character type)
1234 0.123 ‘A’


(Integer type)


(Floating-point type)


(Character type)
.
1234 0.123 ‘A’


(Integer type)


(Floating-point type)


(Character type)
short
int
long
float
double
char
1234 0.123 ‘A’


(Integer type)


(Floating-point type)


(Character type)


.
short
int
long
float
double
char
1234 0.123 ‘A’


(Integer type)


(Floating-point type)


(Character type)


.
short
int
long
float
double
char2byte
4byte
8byte
4byte
8byte
1byte
#include<stdio.h>
int main(void)
{
int x;
printf(" x : %dn", sizeof(x));
printf("char : %dn", sizeof(char));
printf("int : %dn", sizeof(int));
printf("short : %dn", sizeof(short));
printf("long : %dn", sizeof(long));
printf("float : %dn", sizeof(float));
printf("double : %dn", sizeof(double));
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sizeof.c
Lab
,
1. , _ 

2. .

3. (_) .

4. .

5. C .
a1 _
!
aName
a Name
_abc123
123abc_
index Index
C
index Index
C 

(reserved words) .
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
char c; // (1)
int sum; // (2)
double rate; // (3)
int width, height; // width height
char c = 'a';
int sum = 0;
double rate = 4.9;
int width = 100, height = 200;
char c = 'a';
int sum = 0;
double rate = 4.9;
int width = 100, height = 200;
.
int value;
value = 10;
value = 20;
int value1 = 10;
int value2;
value2 = value1; // value2 value1
??


.
??


.
??


.
??


.
??


.
??


.
GIGO(garbage-in garbage-out)

: .
( ) .
( )
??


.
??


.
GIGO(garbage-in garbage-out)

: .
( ) .
( )
??


.
??


.
GIGO(garbage-in garbage-out)

: .
int num1;
( ) .
( )
??


.
??


.
GIGO(garbage-in garbage-out)

: .
int num1;
int num2;
( ) .
( )
??


.
??


.
GIGO(garbage-in garbage-out)

: .
int num1;
int num2;
num2 = num1 + 100; // ??
( ) .
( )
??


.
??


.
GIGO(garbage-in garbage-out)

: .
int num1;
int num2;
num2 = num1 + 100; // ??
//
04 1 변수와 자료형

Mais conteúdo relacionado

Semelhante a 04 1 변수와 자료형

Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocationViji B
 
LDAP Synchronization Connector (LSC)
LDAP Synchronization Connector (LSC)LDAP Synchronization Connector (LSC)
LDAP Synchronization Connector (LSC)Jonathan Clarke
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogramprincepavan
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogramprincepavan
 
Cse115 lecture14strings part01
Cse115 lecture14strings part01Cse115 lecture14strings part01
Cse115 lecture14strings part01Md. Ashikur Rahman
 
CJavaa) Variable declarationint a;variable to store integer .pdf
CJavaa) Variable declarationint a;variable to store integer .pdfCJavaa) Variable declarationint a;variable to store integer .pdf
CJavaa) Variable declarationint a;variable to store integer .pdfanurag1231
 
introduction to strings in c programming
introduction to strings in c programmingintroduction to strings in c programming
introduction to strings in c programmingmikeymanjiro2090
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -Wataru Kani
 
Unit 3 Input Output.pptx
Unit 3 Input Output.pptxUnit 3 Input Output.pptx
Unit 3 Input Output.pptxPrecise Mya
 
Presentation more c_programmingcharacter_and_string_handling_
Presentation more c_programmingcharacter_and_string_handling_Presentation more c_programmingcharacter_and_string_handling_
Presentation more c_programmingcharacter_and_string_handling_KarthicaMarasamy
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocationNaveen Gupta
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and StringTasnima Hamid
 

Semelhante a 04 1 변수와 자료형 (17)

Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
LDAP Synchronization Connector (LSC)
LDAP Synchronization Connector (LSC)LDAP Synchronization Connector (LSC)
LDAP Synchronization Connector (LSC)
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
T02 a firstcprogram
T02 a firstcprogramT02 a firstcprogram
T02 a firstcprogram
 
Cse115 lecture14strings part01
Cse115 lecture14strings part01Cse115 lecture14strings part01
Cse115 lecture14strings part01
 
CJavaa) Variable declarationint a;variable to store integer .pdf
CJavaa) Variable declarationint a;variable to store integer .pdfCJavaa) Variable declarationint a;variable to store integer .pdf
CJavaa) Variable declarationint a;variable to store integer .pdf
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
 
introduction to strings in c programming
introduction to strings in c programmingintroduction to strings in c programming
introduction to strings in c programming
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Karakter dan String
Karakter dan StringKarakter dan String
Karakter dan String
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 
Unit 3 Input Output.pptx
Unit 3 Input Output.pptxUnit 3 Input Output.pptx
Unit 3 Input Output.pptx
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
Presentation more c_programmingcharacter_and_string_handling_
Presentation more c_programmingcharacter_and_string_handling_Presentation more c_programmingcharacter_and_string_handling_
Presentation more c_programmingcharacter_and_string_handling_
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
2 data and c
2 data and c2 data and c
2 data and c
 

Mais de Changwon National University

생성인공지능둘러보기.pdf
생성인공지능둘러보기.pdf생성인공지능둘러보기.pdf
생성인공지능둘러보기.pdfChangwon National University
 
알아두면 편리한 macOS 에디터 단축키와 기능
알아두면 편리한 macOS 에디터  단축키와 기능알아두면 편리한 macOS 에디터  단축키와 기능
알아두면 편리한 macOS 에디터 단축키와 기능Changwon National University
 
키보드 기호의 이름 알아보기(한국어, 영어)
키보드 기호의 이름 알아보기(한국어, 영어)키보드 기호의 이름 알아보기(한국어, 영어)
키보드 기호의 이름 알아보기(한국어, 영어)Changwon National University
 
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)Changwon National University
 
18 2 파이썬표준라이브러리
18 2 파이썬표준라이브러리18 2 파이썬표준라이브러리
18 2 파이썬표준라이브러리Changwon National University
 
15 2 클래스정의와self
15 2 클래스정의와self15 2 클래스정의와self
15 2 클래스정의와selfChangwon National University
 

Mais de Changwon National University (20)

생성인공지능둘러보기.pdf
생성인공지능둘러보기.pdf생성인공지능둘러보기.pdf
생성인공지능둘러보기.pdf
 
2011 app center Changwon National Univ.
2011 app center Changwon National Univ.2011 app center Changwon National Univ.
2011 app center Changwon National Univ.
 
인공지능의 파도가 온다
인공지능의 파도가 온다인공지능의 파도가 온다
인공지능의 파도가 온다
 
Mobile Healthcare Application
Mobile Healthcare ApplicationMobile Healthcare Application
Mobile Healthcare Application
 
바다 즐기기
바다 즐기기바다 즐기기
바다 즐기기
 
알아두면 편리한 macOS 에디터 단축키와 기능
알아두면 편리한 macOS 에디터  단축키와 기능알아두면 편리한 macOS 에디터  단축키와 기능
알아두면 편리한 macOS 에디터 단축키와 기능
 
키보드 기호의 이름 알아보기(한국어, 영어)
키보드 기호의 이름 알아보기(한국어, 영어)키보드 기호의 이름 알아보기(한국어, 영어)
키보드 기호의 이름 알아보기(한국어, 영어)
 
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)
AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)
 
20 2 강의를 마치며
20 2 강의를 마치며20 2 강의를 마치며
20 2 강의를 마치며
 
20 1 코딩스타일
20 1 코딩스타일20 1 코딩스타일
20 1 코딩스타일
 
18 2 파이썬표준라이브러리
18 2 파이썬표준라이브러리18 2 파이썬표준라이브러리
18 2 파이썬표준라이브러리
 
18 1 파이썬패키지
18 1 파이썬패키지18 1 파이썬패키지
18 1 파이썬패키지
 
17 2 필터함수와 맵함수
17 2 필터함수와 맵함수17 2 필터함수와 맵함수
17 2 필터함수와 맵함수
 
17 1 람다함수
17 1 람다함수17 1 람다함수
17 1 람다함수
 
16 1 상속과super()
16 1 상속과super()16 1 상속과super()
16 1 상속과super()
 
15 2 클래스정의와self
15 2 클래스정의와self15 2 클래스정의와self
15 2 클래스정의와self
 
14 4 슬라이싱
14 4 슬라이싱14 4 슬라이싱
14 4 슬라이싱
 
14 2 iterator
14 2 iterator14 2 iterator
14 2 iterator
 
14 3 리스트함수
14 3 리스트함수14 3 리스트함수
14 3 리스트함수
 
14 1 리스트의 메소드
14 1 리스트의 메소드14 1 리스트의 메소드
14 1 리스트의 메소드
 

Último

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 

Último (20)

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 

04 1 변수와 자료형

  • 1.
  • 2. ( ) , ,
  • 3. ( ) , , main memory
  • 4. ( ) , , main memory
  • 5. 0xFF ( ) , , main memory
  • 6. 0xFF ( ) , , main memory radius radius
  • 7. 0xFF ( ) , , main memory radius radius500 / /
  • 9. 1234 0.123 ‘A’ (Integer type) (Floating-point type) (Character type)
  • 10. 1234 0.123 ‘A’ (Integer type) (Floating-point type) (Character type) .
  • 11. 1234 0.123 ‘A’ (Integer type) (Floating-point type) (Character type) short int long float double char
  • 12. 1234 0.123 ‘A’ (Integer type) (Floating-point type) (Character type) . short int long float double char
  • 13. 1234 0.123 ‘A’ (Integer type) (Floating-point type) (Character type) . short int long float double char2byte 4byte 8byte 4byte 8byte 1byte
  • 14. #include<stdio.h> int main(void) { int x; printf(" x : %dn", sizeof(x)); printf("char : %dn", sizeof(char)); printf("int : %dn", sizeof(int)); printf("short : %dn", sizeof(short)); printf("long : %dn", sizeof(long)); printf("float : %dn", sizeof(float)); printf("double : %dn", sizeof(double)); return 0; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 sizeof.c
  • 15. Lab
  • 16. , 1. , _ 2. . 3. (_) . 4. . 5. C . a1 _ ! aName a Name _abc123 123abc_ index Index C index Index
  • 17. C (reserved words) . auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 18. char c; // (1) int sum; // (2) double rate; // (3) int width, height; // width height
  • 19. char c = 'a'; int sum = 0; double rate = 4.9; int width = 100, height = 200;
  • 20. char c = 'a'; int sum = 0; double rate = 4.9; int width = 100, height = 200;
  • 21. . int value; value = 10; value = 20; int value1 = 10; int value2; value2 = value1; // value2 value1
  • 22.
  • 23. ?? .
  • 24. ?? .
  • 27. ( ) . ( ) ?? . ?? . GIGO(garbage-in garbage-out) : .
  • 28. ( ) . ( ) ?? . ?? . GIGO(garbage-in garbage-out) : . int num1;
  • 29. ( ) . ( ) ?? . ?? . GIGO(garbage-in garbage-out) : . int num1; int num2;
  • 30. ( ) . ( ) ?? . ?? . GIGO(garbage-in garbage-out) : . int num1; int num2; num2 = num1 + 100; // ??
  • 31. ( ) . ( ) ?? . ?? . GIGO(garbage-in garbage-out) : . int num1; int num2; num2 = num1 + 100; // ?? //