here's some literal code:
ERRORS: (they get cut off where they are by the compiler :( )
271 C:\TCWIN45\BIN\dev c++\battle system\version 3\main.cpp
request for member `rules' in `game.gamesStruct::dice()', which
272 C:\TCWIN45\BIN\dev c++\battle system\version 3\main.cpp
request for member `run' in `game.gamesStruct::dice()', which is
Main.cpp
Code:
...
#ifndef _GAMES_H
#define _GAMES_H
#include "games.h" //gamesStruct for Merchant Alley
#endif
...
int main(){
...
gamesStruct game;
...
if(ans==1)
{
game.dice.rules();
game.dice.run();
}
...
ALL of games.h
Code:
#ifndef _DICE_H
#define _DICE_H
#include "dice.h"
#endif
struct gamesStruct
{
diceClass dice(); //create instance of dice class
};
ALL of dice.h
Code:
class diceClass
{
public:
diceClass(); //initializer
void run(char*); //starts with username
void rules(); //prints rules
private:
void setstats(char*); //sets stats
void savestats(); //saves changed stats
int rolldice(); //returns random number between 1..6
char username[20]; //holds username
char password[20]; //holds password
int hp,atk,def,lvl,exp,mon,pts; //stats
};
and below can be found dice.cpp... it's too big to post...