Linux開發環境下熟悉使用vi/vim編輯器以及makefile實作函式的呼叫
- c語言輸出"hello world"
- 呼叫函式sub1.c檔案在main.c主程式檔案執行
- Ubantu系統下用makefile方式編程主程式
c語言輸出"hello world"
1、在當前檔案夾下創建hello.c檔案
touch hello.c
2、使用vim文本編輯器編輯
vim hello.c

3、使用gcc創建可執行檔案hello輸出

呼叫函式sub1.c檔案在main.c主程式檔案執行
1、創建sub1.c、sub1.h和main.c檔案
touch sub1.c
touch main.c
2、使用vim編輯三個檔案
(1)vim sub1.c

(2)vim sub1.h

(3)vim main.c

3、采用gcc編譯主程式回傳值

4、windows環境下實作同樣功能


Ubantu系統下用makefile方式編程主程式
1創建makefile
touch makefile
2、呼叫前面所述的sub1.c、main.c檔案使用vim編輯makefile

3、使用make命令編譯出可執行檔案main并運行

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/132279.html
標籤:其他
上一篇:HashMap總結
