Hi Folks,
I'm working through cprogramming.com's If Statement's tutorial and created the following script as directed by the tutorial:
I receive the following errors:Code:#include <iostream.h> int main() { int age; // Variable. cout<<"Please input your age: "; cin>>age; If (age<100) { cout<<"You are pretty young!"; } Else If(age==100) { cout<<"You are old"; } Else { } return 0; }
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Documents and Settings\David Mackey\My Documents\cprograms\ageasker.cpp" -o "C:\Documents and Settings\David Mackey\My Documents\cprograms\ageasker.exe" -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
In file included from C:/Dev-Cpp/include/c++/backward/iostream.h:31,
from C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:1:
C:/Dev-Cpp/include/c++/backward/backward_warning.h:32:2: 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 <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp: In
function `int main()':
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:7: `
If' undeclared (first use this function)
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:7: (Each
undeclared identifier is reported only once for each function it appears
in.)
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:8: parse
error before `{' token
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp: At
global scope:
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:9: `
age' was not declared in this scope
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:10: parse
error before `{' token
C:/Documents and Settings/David Mackey/My Documents/cprograms/ageasker.cpp:12: syntax
error before `{' token
Execution terminated
If someone could help me through this I would be grateful. I am using Blood's Dev-C++ IDE with MinGW's port of the GNU compiler.
Respectfully,
David Mackey.