
Originally Posted by
pp19weapon
I don't get what's wrong with it.
() usually denotes a function call:
the line "Level level();" ( @
gresan6 is wrong; I think) is fine -- you're calling the constructor for level -- this is normal -- just like in the line above, where you're calling a constructor function of the player class.
For the third line, you're simply trying to refer to a member variable, so it should be the identifier followed by the dot operator
ex. myLevel.Size , myLevel.Name, myLevel.Age, etc etc..using the '.' member operator - no ()'s....() = function call
(and if you were using a pointer type, you'd use the -> operator, not the dot operator)
edit: to fix, change
Code:
level().loadLevel(fileName); // is bad
to
Code:
level.loadLevel(fileName); // is good