看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Mac上使用gcc compiler 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 應該無 問題(Question):試著使用getch()來達成按任意鍵繼續的行為,但是一直無法成功 餵入的資料(Input): 無,很純粹的一個Hello World程式,主要想試驗按任意鍵繼續的功能 ---- compiler 時在teminal下的command: gcc test.c -lcurses -o test 預期的正確結果(Expected Output): 會先出先"Hello World!" 然後等我按任意鍵繼續才出現"End of Hello World!" 錯誤結果(Wrong Output): "Hello World!"跟"End of Hello World "一起出現 程式碼(Code):(請善用置底文網頁, 記得排版) http://ideone.com/pGbR3o 補充說明(Supplement): 想請問在mac寫C是不是比較不適合呢? 在寫的過程一直遇到在Windows下沒發生過的問題@@ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.3.199 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1441959243.A.424.html
kerwinhui: 用getch()之前要先initscr();cbreak();noecho();等等 09/11 17:08
kerwinhui: 看來你也想要 nodelay(stdscr,0); 09/11 17:10
Qbsuran: 很基本就別來問 09/11 21:06
dinex: Xcode自動編譯很強大誒 09/13 19:50