[問題] [200P] 如何在 Code 裡面判別 VC 版本?
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC6, VC2008
問題(Question):
因為有的人用 VC6, 有的人用 VC2008
但是 VC2008 有些東西 VC6 不會過
想說有沒有甚麼辦法用類似 #ifdef 這種 condition compiler 的方式判別
如果是 VC6 跑一種,VC2008 跑另一種
以下用 strcat_s 作例子
餵入的資料(Input):
strcat_s
預期的正確結果(Expected Output):
讓 VC2008 跑 strcat_s,VC6 跑 strcat
程式碼(Code):(請善用置底文網頁, 記得排版)
#ifdef ??? // VC2008
strcat_s 是 strcat_s
#else // VC6
strcat_s 是 strcat
#endif
補充說明(Supplement):
第一位幫忙的人送 200P 獎金。謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 180.177.104.226
→
05/17 07:14, , 1F
05/17 07:14, 1F
→
05/17 08:52, , 2F
05/17 08:52, 2F
推
05/17 12:26, , 3F
05/17 12:26, 3F
推
05/18 22:32, , 4F
05/18 22:32, 4F