Ok, i switched from coding a MUD to a regular text based game... I decided to use a structure to hold the player information, and anything that you can fight (trying to keep organised, and easier to change) but i keep getting this error:
[montez@localhost codes]$ c++ game.cpp -o game -O2 -Wall
game.cpp: In function `void name()':
game.cpp:37: error: request for member `player' in `name', which is of non-class type `void ()()'
when i try to compile it... this is my souce so far:
any help would be appreciatedCode:#include <iostream> using namespace std; struct stats { //declairs a structure that holds the player information string name; //players name string weapon; //players weapon int life; //players life }; void intro(); void name(); void intro() { cout<<"--------------------------------------------- "<<endl; cout<<"---- ---- "<<endl; cout<<"---- ---- "<<endl; cout<<"---- -My Game- ---- "<<endl; cout<<"---- ---- "<<endl; cout<<"---- ---- "<<endl; cout<<"---- -By: Goosie- ---- "<<endl; cout<<"---- ---- "<<endl; cout<<"---- ---- "<<endl; cout<<"--------------------------------------------- "<<endl; name(); } int main() { stats player; player.life = 100; intro(); } void name() { cout<<"Enter your name: "; cin>>name.player; }![]()



LinkBack URL
About LinkBacks




oops...