Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
C 程式語言 I
Search
Nedval
September 23, 2016
Education
0
110
C 程式語言 I
Nedval
September 23, 2016
Tweet
Share
More Decks by Nedval
See All by Nedval
if else statement
nedval
0
55
軟體測試與驗證—CI & CU
nedval
0
84
SQL Intro
nedval
0
100
Other Decks in Education
See All in Education
ThingLink
matleenalaakso
28
4.3k
TypeScript初心者向け完全ガイド
mickey_kubo
1
120
くまのココロンともぐらのロジ
frievea
0
150
Introduction - Lecture 1 - Advanced Topics in Big Data (4023256FNR)
signer
PRO
2
2.2k
多様なメンター、多様な基準
yasulab
PRO
5
19k
AIは若者の成長機会を奪うのか?
frievea
0
180
The Next Big Step Toward Nuclear Disarmament
hide2kano
0
220
Going over the Edge
jonoalderson
0
360
Chapitre_2_-_Partie_2.pdf
bernhardsvt
0
170
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
✅ レポート採点基準 / How Your Reports Are Assessed
yasslab
PRO
0
280
Design Guidelines and Models - Lecture 5 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Thoughts on Productivity
jonyablonski
74
5k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
260
Building Adaptive Systems
keathley
44
2.9k
Believing is Seeing
oripsolob
1
56
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Fireside Chat
paigeccino
41
3.8k
Transcript
C 程式語言 by
[email protected]
C 程式語言
C 程式語言 文法(Grammar)
C 程式語言 文法(Grammar) 語法(syntax)
句型 e.g., S + V + O
陳述 (statement)
宣告陳述式 (Declaration Statements)
宣告陳述式 (Declaration Statements) 型態 變數名稱 值 type variable name value
型態 變數名稱 值 type variable name value 讓人容易閱讀的代稱
型態 變數名稱 值 type variable name value 代稱所代表的內容
型態 變數名稱 值 type variable name value 內容的類型
先離題一下 … 聽說最近有部電影很紅
先離題一下 … 聽說最近有部電影很紅 名字是 …
君の名は
your name
your name
your name 讓我們試著把這部電影的名稱用 C 語言表示
your name
your name 名詞
your name 名詞 字串(string)
your name 名詞 字串(string) C 語言中又稱字元陣列
your_name 變數名稱限制: 開頭不能是數字 中間不能空白 … 等 字串(string)
your_name char* 一個變數名稱通常代表兩個特質
your_name char* 空間 值 { 一個變數名稱通常代表兩個特質
your_name char* 空間 值 { 一個變數名稱通常代表兩個特質
your_name char* 這個陳述中,只有宣告了一個代號為 your_name 的空間 裡面可以放字元陣列的值,由於尚未放任何內容進去 因此現在 your_name 裡面沒有任何東西 如同電影「你的名字」一樣
在你進電影院前不知道「你的名字」到底是什麼
your_name char* 假如,我們看完電影了,已經知道名字到底是什麼 我們要怎麼放到 your_name 這個空間呢?
your_name char* ... 假如這是主角的名字 它是字串型態
your_name char* "..." 字串型態的內容應放在雙引號中
your_name char* "..." 至於你的名字到底叫什麼?
your_name char* "..." 就請大家進影院看啦~
your_name char* "..." 現在我們有「型態」「變數名稱」以及「值」了 可是 這樣還不是一個完整的陳述 (statement)
your_name char* "..." = 我們需要加一個「這個」
your_name char* "..." = 「這個」是什麼?
your_name char* "..." = 等於?
your_name char* "..." = 等於? NO!!!
What?
蕭煌奇唱過一首歌
那首歌是這樣唱的 …
眼前的等於不是等於~ 你說的等號是什麼等號?
= 在 C 以及多數程式語言中 一個等號稱為:賦值(assign)
= 在 C 以及多數程式語言中 一個等號稱為:賦值 assign 意即賦予等號左邊的空間擁有右邊的值
= 在 C 以及多數程式語言中 一個等號稱為:賦值 assign 意即賦予等號左邊的空間擁有右邊的值
例句
My name is Jrting
My name is Jrting 變數名稱
My name is Jrting 變數名稱 my_name
My name is Jrting 賦值 my_name
My name is Jrting 賦值 = my_name
My name is Jrting 型態:字串 = my_name
My name is Jrting 型態:字串 char* "" = my_name
My name is Jrting 值 char* "Jrting" = my_name
My name is Jrting char* "Jrting" = my_name
結束了嗎?
還沒~
你忘了一件事…
英文老師說句子的結尾要句點
My name is Jrting. char* my_name = "Jrting" Important !!!
My name is Jrting. char* my_name = "Jrting"; Important !!!
上機練習