Examples include substituting the <X> header for the <X.h> \
header for C++ includes, or <iostream> instead of the deprecated header \
<iostream.h>.
Um..... I think your compiler has said it all... Try actually reading it.
The way you've written your code is not per the current C++ standards. There are no headers that are part of the current standard that end with ".h"...
Fbody
Posting Maven
2,929 posts since Oct 2009
Reputation Points: 833
Solved Threads: 394
Skill Endorsements: 5
>>Did you mean, i should use <iostream> instead of <iostream.h>?
That's exactly what I/it mean(s).
>>but then i'm getting errors like "cout was not declared in this scope" or "endl was not declared in this scope"..i think in this case they can't find the header files where these functions are written
Nope. It means you didn't resolve your namespace properly. All functions and objects that are members of the standard headers are declared within the "std" namespace. To get to them, you must resolve the namespace.
Fbody
Posting Maven
2,929 posts since Oct 2009
Reputation Points: 833
Solved Threads: 394
Skill Endorsements: 5
In other words, add the line using namespace std; after your header.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
Question Answered as of 2 Years Ago by
Fbody
and
WaltP