My main code variable declaration (just declaration no login statement)
struct AXEMAN{
int lvl;
int att;
int hp;};
struct DEFENDER{
int lvl;
int att;
int hp;};
struct ARCHER{
int lvl;
int att;
int hp;};
struct SPEARMAN{
int lvl;
int att;
int hp;};
struct ROUGE{
int lvl;
int att;
int hp;};
#include "header.h" / have to under struct... so that the struct has been declared
int main(int argc, char *argv[])
{
struct AXEMAN axeman;
struct DEFENDER defender;
struct ARCHER archer;
struct ROUGE rouge;
struct SPEARMAN spearman;
string input;
int sel_MainMenu=99,sel_GameMenu=99,sel_SubGameMenu=99,sel_Motion=99;
int sel_Movement_num=99;
char sel_Movement;
int sel_char_num=99,sel_enermy_num=99;
char sel_char,sel_enermy;
int comp_dmg,player_dmg,comp_hp,player_hp;
int quit=0;
int error=0;
char matrix[70][50]; //x=70 , y=50
int x,y;
bool detected_comp=0,detected_player=0,skip=0;
==================================================
This code will be called under "header.h" (my subfunction in another .c file)
void initialize_status_player(AXEMAN &axeman, DEFENDER &defender, ARCHER &archer, SPEARMAN &spearman, ROUGE &rouge)
{
axeman. lvl=1;
axeman. att=40;
axeman. hp=450;
defender. lvl=1;
defender. att=30;
defender. hp=500;
archer. lvl=1;
archer. att=50;
archer. hp=300;
spearman. lvl=1;
spearman. att=45;
spearman. hp=400;
rouge. lvl=1;
rouge. att=35;
rouge. hp=350;
}
PROBLEM:
`ARCHER' was not declared in this scope
`archer' was not declared in this scope
SO:
what is the way i have to declare variable...
or my header file calling method has problem?
thx for help