Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
C 程式語言 I
Search
Nedval
September 23, 2016
Education
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
C 程式語言 I
Nedval
September 23, 2016
Transcript
60 slides
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 !!!
上機練習
More Decks by Nedval
See All by Nedval
if else statement
nedval
0
69
軟體測試與驗證—CI & CU
nedval
0
87
SQL Intro
nedval
0
110
Other Decks in Education
See All in Education
みんなのコード 2025年度活動報告書/ 2026年度活動計画書
codeforeveryone
0
110
JavaScript - Lecture 6 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 Training Series, Session Six: Licensing & Market Power"
baltimoreniso
0
160
Session 6 - Mass Communication
adeputra13
0
360
[2026後期火5] 論理学(京都大学文学部 後期 第1回)「名前はあるのに、誰なのかわからない」
yatabe
0
220
2026年度秋学期 統計学 第4回 データを「分布」で見る (2026. 10. 20)
akiraasano
PRO
0
220
XML and Related Technologies - Lecture 7 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Web Application Frameworks - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
人間関係に取り組む、その時に / step away to make space
spring_aki
0
210
1007
cbtlibrary
0
290
[2026後期火5] 論理学(京都大学文学部 後期 第6回)「等号と個体化」
yatabe
0
180
1002
cbtlibrary
0
570
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.3k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
490
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Docker and Python
trallard
47
4.3k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
690
A Tale of Four Properties
chriscoyier
163
24k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k