SlideShare a Scribd company logo
1 of 18
Previously
Learning Goal
1. 컴퓨터는 데이터를 어디에서 읽고 어디로 쓰는가?
2. 변수와 상수란?
3. 기호상수는 왜 쓰는가?
4. 객체에서 따져봐야 할 두 가지는?
5. 타입이란?
6. 선언과 정의의 차이란?
2. 변수와 상수를 입출력 할 수 있다.
1. 캐스팅을 이해한다.
Casting
to convert a value into other type
(type)variable
type(variable)
Safe
It’s safe to convert small size type into large size type
- Integer to Integer(Promotion)
- Integer to Floating point number
Casting
Unsafe(narrowing)
It’s not safe to convert large size type into small size type
- Integer to Integer
- Signed to Unsigned
- Floating point number to Integer
to convert a value into other type
(type)variable
type(variable)
printf( ), scanf( )
int printf("형식 문자열", 변수)
int scanf("형식 문자열", &변수)
100
Value
0x53AB97FB
printf( )
%[플래그][너비][.소수점][길이]형식자
printf( )
%[플래그][너비][.소수점][길이]형식자=
scanf( )
공백문자, 비공백문자, %[*][너비][길이]형식자
printf( ), scanf( )
int printf("형식 문자열", 변수)
int scanf("형식 문자열", &변수)
- 성공 시 출력된 문자 수만큼 반환
- 실패 시 음수 반환
printf( )
- 성공 시 성공적으로 입력 받은 수를 반환
- 실패 시 EOF 반환
scanf( )
간단한 입출력
Basic study 3회차
Basic study 3회차

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Basic study 3회차

Editor's Notes

  1. 변수란? RAM
  2. 변수란? RAM
  3. 왜 초기화하는 습관을 들어야 하냐면 이 쓰레기값을 행여나 어디서 읽게 되면 프로그램이 미정의 동작(undefined behavior)을 일으키게 되기 때문이다. 변수 사용시엔 꼭 초기화하자. Lvalue, rvalue
  4. 왜 초기화하는 습관을 들어야 하냐면 이 쓰레기값을 행여나 어디서 읽게 되면 프로그램이 미정의 동작(undefined behavior)을 일으키게 되기 때문이다. 변수 사용시엔 꼭 초기화하자. Lvalue, rvalue
  5. 왜 초기화하는 습관을 들어야 하냐면 이 쓰레기값을 행여나 어디서 읽게 되면 프로그램이 미정의 동작(undefined behavior)을 일으키게 되기 때문이다. 변수 사용시엔 꼭 초기화하자. Lvalue, rvalue
  6. 왜 초기화하는 습관을 들어야 하냐면 이 쓰레기값을 행여나 어디서 읽게 되면 프로그램이 미정의 동작(undefined behavior)을 일으키게 되기 때문이다. 변수 사용시엔 꼭 초기화하자. Lvalue, rvalue
  7. 왜 초기화하는 습관을 들어야 하냐면 이 쓰레기값을 행여나 어디서 읽게 되면 프로그램이 미정의 동작(undefined behavior)을 일으키게 되기 때문이다. 변수 사용시엔 꼭 초기화하자. Lvalue, rvalue