If Syntax error

I get two annoying if syntax errors when I try to compile my program. Here's the code that has the error

1
2
3
4
5
6
void arrowtower::upgrade(const player &cplayer){
	if (player.getGold() >= upgradecost){
		damage += 2;
		upgradecost += 8;
	}
}


The errors are:

1
2
1>h:\documents and settings\rensel\desktop\c++ projects\deathtogoblins\deathtogoblins\arrowtower.cpp(11) : error C2059: syntax error : '.'
1>h:\documents and settings\rensel\desktop\c++ projects\deathtogoblins\deathtogoblins\arrowtower.cpp(11) : error C2143: syntax error : missing ';' before '{'
Last edited on
player looks like a class name.
cplayer is your object.

so line 2 probably was supposed to be cplayer.getGold, not player.getGold
Topic archived. No new replies allowed.