I need to compile code on my linux system. This is simple code and I don't know what's wrong:
I have this code and I can't compile it:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string char1, char2, char3, char4, char5, char6;
cout<<"Hello this is your standard True and False quiz"<<endl;
cout<<"Please enter 'T' or 'F'"<<endl;
cout<<"No#1 George Washington invented the toilet?"<<endl;
cin>>char1;
if ( char1 != "T" || "F")
{
cout<<"You entered an incorrect character please reenter True of False"<<endl;
cin>>char1;
}
if ( char1 != "T" || "F")
{
cout<<"You entered an incorrect character please reenter True of False"<<endl;
cin>>char1;
}
if ( char1 == "T" )
{
cout<<"You entered the incorrect answer. The answer is False"<<endl;
}
cout<<"No#2 The Squareroot of 3136 is 56?"<<endl;
cin>>char2;
if ( char2 != "T" || "F")
{
cout<<"You entered an incorrect character please reenter True of False"<<endl;
cin>>char2;
}
if ( char2 != "T" || "F")
{
cout<<"You entered an incorrect character please reenter True of False"<<endl;
cin>>char2;
}
if ( char2 == "F" )
{
cout<<"You entered the incorrect answer. The answer is True"<<endl;
}
cout<<"No#3
system("PAUSE");
return 0;
}
When I try to compile it:
gcc file.c
I get:
test.c:1: fatal error: iostream: No such file or directory
compilation terminated.
As far as I know, I have all the libraries needed, what am I doing wrong?