課程Github:
https://github.com/QQBoxy/2018vc
語言技術:C++ Gossip:
https://openhome.cc/Gossip/CppGossip/
Example 1 - argc argv
https://github.com/QQBoxy/2018vc/blob/master/argcargv/main.cpp
VC設定測試參數:
跳脫字元:
escape sequence | 說明 |
\n | 換行、新行(newline) |
\t | 水平定位點(horizontal tab) |
\v | 垂直定位點(vertical tab) |
\b | 退回一格(backspace) |
\r | 返回(carriage return) |
\f | 換頁(formfeed) |
\a | 嗶聲(alert bell) |
\\ | 倒斜線(backslash) |
\? | 問號 |
\' | 單引號 |
\" | 雙引號 |
FYI:http://openhome.cc/Gossip/CppGossip/LiteralConstant.html
Example 2 - data type
https://github.com/QQBoxy/2018vc/blob/master/datatype/main.cpp
Example 3 - if else, switch case, for loop
https://github.com/QQBoxy/2018vc/blob/master/conditionalloop/main.cpp
Example 4 - Array and Pointer
https://github.com/QQBoxy/2018vc/blob/master/arraystatement/main.cpp
陣列在記憶體中的排列方式:
int arr[2][4] = {
{ 1, 2, 3, 4 }, { 5, 6, 7, 8 }
};
陣列 | ... | arr[0][0] | arr[0][1] | arr[0][2] | arr[0][3] | arr[1][0] | arr[1][1] | arr[1][2] | arr[1][3] | ... |
資料 | ... | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ... |
Example 5 - String convert
https://github.com/QQBoxy/2018vc/blob/master/stringconvert/main.cpp
作業:
請撰寫一個簡易音樂播放器,能夠輸入簡譜並演奏一段音樂。(請使用陣列儲存簡譜)
基礎範例程式:
https://github.com/QQBoxy/2018vc/blob/master/piano/main.cpp
單音階鋼琴聲音檔:
https://github.com/pffy/wav-piano-sound
結果參考範例:
https://github.com/QQBoxy/2018vc/blob/master/player.zip
沒有留言:
張貼留言