# 來做出第一個程式 ## 1.產生原始碼 用純文字編輯器,另存成`*.c` ## 2.使用PowerShell產生物件檔 - 在要打開的資料夾按下`鍵盤Shift+滑鼠右鍵`(如此才能打開終端機) - 要打開的資料夾:存放開發工具的地方(也就是gcc編譯器所在位置) - Shell:殼層 - `./`Windows10後不像早期CMD可以不加這個 ```powershell= ./gcc.exe -c hi.c ``` - 注意權限 以系統管理員身分獨立開啟PowerShell - `*.exe`的`exe`可以省略 - 補充:如果檔名是純數字不行 - `cd`移動至路徑 - 空格辨識問題 - `"路徑"` ## 3.再產生執行檔 ```powershell= ./gcc.exe -o hi.exe hi.o ``` - 為什麼不是餵給`ld.exe`? 因為無法直接呼叫 - 只好使用`gcc.exe -o`間接呼叫 - `*.o`是output的檔案 ## 4.然後執行看看 `檔名.exe` #### 程式語言類型 - 編譯式程式 - 不離上方4個步驟 - 直譯式語言 - 給CPU看的 - 如:Python、Javascript、PHP
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up