[問題] 請想問 .h 問題

看板C_and_CPP作者 (~飛~)時間13年前 (2011/02/09 10:22), 編輯推噓5(503)
留言8則, 6人參與, 最新討論串1/2 (看更多)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) visual c++ 6.0 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 各位前輩好   最近看書有看到 在 include 標頭檔的時候 1. #include <cstdlib> #include <cstdio> #include <cmath> 2. #include <stdlib.h> #include <stdio.h> #include <math.h> 我想問的是 1 跟 2 的詳細差別在哪裡 聽說 1 的寫法比較好 !? 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.135.11.183

02/09 10:27, , 1F
你看內容就知道了
02/09 10:27, 1F

02/09 13:01, , 2F
c/c++並沒有硬性規定header的命名標準, 這兩種的寫法
02/09 13:01, 2F

02/09 13:02, , 3F
主要是歷史因素為了區分c或cpp而已.
02/09 13:02, 3F

02/09 13:38, , 4F
namespace std 差在這
02/09 13:38, 4F

02/09 13:54, , 5F
按C++標準走會好
02/09 13:54, 5F

02/09 14:44, , 6F
看你要寫的是 C還是C++
02/09 14:44, 6F

02/09 15:07, , 7F
1:C++ style, 2:C style
02/09 15:07, 7F

02/09 21:01, , 8F
我覺得一樓才是正解, include不可能看名字就知道內容...
02/09 21:01, 8F
文章代碼(AID): #1DKVf-3h (C_and_CPP)
文章代碼(AID): #1DKVf-3h (C_and_CPP)