Something is wrong with it.....
It gives me the following error:
and this is the script...:Code:c:\c__~1\island.cpp: In function `int main()': c:\c__~1\island.cpp:31: `yes' undeclared (first use this function) c:\c__~1\island.cpp:31: (Each undeclared identifier is reported only once c:\c__~1\island.cpp:31: for each function it appears in.) c:\c__~1\island.cpp:35: `y' undeclared (first use this function) c:\c__~1\island.cpp:39: `ya' undeclared (first use this function) c:\c__~1\island.cpp:43: `yup' undeclared (first use this function)
Code:#include <iostream> int main() { int slot1; int slot2; int slot3; int slot4; int slot5; char endr[20]; char sure[20]; cout<<"Please enter the top 5 things you would like to have if you were on an island alone"<<endl; cout<<"Type the first and most important thing"<<endl; cin>>slot1; cout<<"Type the second thing"<<endl; cin>>slot2; cout<<"Type the third thing"<<endl; cin>>slot3; cout<<"Type the fourth thing"<<endl; cin>>slot4; cout<<"Type the fifth thing and the one that you would least like to have"<<endl; cin>>slot5; cout<<"You liked the following in order"<<endl; cout<<"1. "<<slot1 <<endl; cout<<"2. "<<slot2 <<endl; cout<<"3. "<<slot3 <<endl; cout<<"4. "<<slot4 <<endl; cout<<"5. "<<slot5 <<endl; cout<<"Am I right?"; cin.getline(endr, 20, '\n'); if(endr==yes) { cout<<"I knew it!"; } else if(endr==y) { cout<<"I knew it!"; } else if(endr==ya) { cout<<"I knew it!"; } else if(endr==yup) { cout<<"I knew it!"; } else { cout<<"Are you sure?"; cin>>sure; } if(sure==yes) { cout<<"Sure....whatever you say..."; } else { cout<<"I knew it!"; } return 0; }



LinkBack URL
About LinkBacks


