+ 2
# include <iostream.h> # include <std.h> int main() { cout<<"hello world"; return 0; }
please tell me what's my mistake
2 Réponses
+ 5
C++ header inclusion doesn't need filename and extension, except for custom headers, you can just use #include <iostream>, and as @Bogdan said, if you want to write it that way you need to declare either:
using namespace std;
Or,
using std::cout;
using std::cin;
Or specifically call std::cout / std::cin each time, proportionally.
Hth, cmiiw
+ 3
you either write using namespace std;(using std::cout for efficiency) before main or replace cout with std::cout in main function