+ 2

# include <iostream.h> # include <std.h> int main() { cout<<"hello world"; return 0; }

please tell me what's my mistake

30th Jan 2018, 3:26 PM
Sakshi
Sakshi - avatar
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
30th Jan 2018, 3:55 PM
Ipang
+ 3
you either write using namespace std;(using std::cout for efficiency) before main or replace cout with std::cout in main function
30th Jan 2018, 3:31 PM
bogdan
bogdan - avatar