- Joined
- Jan 21, 2009
- Messages
- 9
- Reaction score
- 0
- Points
- 1
- Location
- Midland, Michigan
- Your Mac's Specs
- MB Pro, 17", 2.5 GHz Intel
I am working on a fairly simple C++ application as a "terminal utility" (i.e. no GUI). When I try to compile my application, I get the following error:
cin.getline(str,100); //this is the line of source
error: 'cin' was not declared in this scope
If I change the include statement from
#include <iostream>
to
#include <iostream.h>
then I get a warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h> etc.
However, the program compiles and runs. So, my question: why doesn't the recommended header (<iostream>) work in this context?
Thanks.
cin.getline(str,100); //this is the line of source
error: 'cin' was not declared in this scope
If I change the include statement from
#include <iostream>
to
#include <iostream.h>
then I get a warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h> etc.
However, the program compiles and runs. So, my question: why doesn't the recommended header (<iostream>) work in this context?
Thanks.