[問題] include iostream 跟 iostream.h 的差別
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++ 6.0
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
無
問題(Question):
只是一個很單純的Hello問題..
程式碼是這樣的 :
#include <iostream>
using namespace std;
void main(void)
{
cout << "Hello!\n";
return;
}
這樣是對的..
但如果只把#include的地方改成
#include <iostream.h>
就會出現 error C2871: 'std' : does not exist or is not a namespace
不太理解為什麼會這樣??
補充說明(Supplement):
我有google了一下 #include<> 與 #include" "的差別
但我在檔案路徑下並沒有任何.h檔 , 所以我想應該都會去找Include路徑下的檔案吧?
而在VC++\Include路徑下 有兩個名為IOSTREAM的檔案
一個看不出附檔名 , 一個附檔名是.h
難道#include<>加了個.h compiler就找不到了嗎?
感謝各位前輩指點..
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.85.133.177
→
10/16 18:54, , 1F
10/16 18:54, 1F
→
10/16 18:55, , 2F
10/16 18:55, 2F
→
10/16 18:55, , 3F
10/16 18:55, 3F
→
10/16 18:55, , 4F
10/16 18:55, 4F
→
10/16 18:56, , 5F
10/16 18:56, 5F
→
10/16 18:57, , 6F
10/16 18:57, 6F
→
10/16 18:57, , 7F
10/16 18:57, 7F
→
10/16 19:00, , 8F
10/16 19:00, 8F
→
10/16 19:01, , 9F
10/16 19:01, 9F
→
10/16 19:01, , 10F
10/16 19:01, 10F
→
10/16 19:03, , 11F
10/16 19:03, 11F
→
10/16 19:03, , 12F
10/16 19:03, 12F
→
10/16 19:03, , 13F
10/16 19:03, 13F
→
10/16 19:10, , 14F
10/16 19:10, 14F
→
10/16 19:13, , 15F
10/16 19:13, 15F
推
10/16 23:49, , 16F
10/16 23:49, 16F
→
10/16 23:53, , 17F
10/16 23:53, 17F
→
10/17 10:02, , 18F
10/17 10:02, 18F
→
10/17 10:02, , 19F
10/17 10:02, 19F
→
10/17 10:04, , 20F
10/17 10:04, 20F
→
10/17 10:05, , 21F
10/17 10:05, 21F
→
10/17 10:05, , 22F
10/17 10:05, 22F
→
10/17 10:06, , 23F
10/17 10:06, 23F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章