While compiling a simple code in c++ i get the errors
C:\Users\ila\Desktop\mule\mule.c|1|iostream: No such file or directory|
C:\Users\ila\Desktop\mule\mule.c||In function `main':|
C:\Users\ila\Desktop\mule\mule.c|6|error: `cout' undeclared (first use in this function)|
C:\Users\ila\Desktop\mule\mule.c|6|error: (Each undeclared identifier is reported only once|
C:\Users\ila\Desktop\mule\mule.c|6|error: for each function it appears in.)|
||=== Build finished: 4 errors, 0 warnings ===|
How do I include header files in c++?
geekme 0 Junior Poster in Training
Recommended Answers
Jump to Post— WaltP 2,905Probably differently than you did in your program. But since you didn't post any code, we can't tell what you did wrong.
Jump to Post— JasonHippy 739The thing you're forgetting here is that cout is a member of the std:: namespace, so you either need to explicitly resolve that cout is part of the std:: namespace by specifying
std::coutevery time you use it e.g.std::cout << "\nhello";Otherwise, to avoid having …
All 5 Replies
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
geekme 0 Junior Poster in Training
JasonHippy 739 Practically a Master Poster
Narue 5,707 Bad Cop Team Colleague
JasonHippy 739 Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.