Hey! Thanks in advance for trying to help! Anyways, I have a ";" error that keeps flashing up.
Wrestling.cpp(46) : error C2146: syntax error : missing ';' before identifier 'cout'
And I swear I have a semicolon before the line. So I'm hoping you guys can help this newbie out.
Here is the code:
(I've underlined the line that needs a semicolon before it)
Its really frustrating me...Code:#include <iostream> #include <string> using namespace std; struct person { double name; int weight; }; void getwrestlerdata(struct person &); void printwrestlerdata(struct person); int main() { person wrestler; getwrestlerdata(wrestler); printwrestlerdata(wrestler); return 0; } void getwrestlerdata(struct person &s) { cout<<"Please enter student's name\n"; cin>>s.name; cout<<"Please enter student's weight(in pounds)\n"; cin>>s.weight; return; } void printwrestlerdata(struct person s) { cout<<s.name<<", who weighs "<<s.weight<<", is classified as a "; if(s.weight<100) cout<<"lightweight. "<<endl; else if(s.weight>99 && s.weight<200) cout<<"middleweight. "; else(s.weight>200) cout<<"heavyweight."<<endl; return; }
I just don't understand what I'm doing wrong.



LinkBack URL
About LinkBacks


