I got the following error, please help me to resolve this problem..
ui.h:10: error: âloginâ has not been declared
db.h:7: error: âloginâ has not been declared
controller.cpp: In member function âvoid control::casino_game()â:
controller.cpp:15: error: âloginâ was not declared in this scope
controller.cpp:15: error: expected `;' before âloâ
controller.cpp:34: error: âloâ was not declared in this scope
login.h
#ifdef LOGIN_H
#define LOGIN_H
class login{
char* luid;
char* lpass;
public:
void set_luid(char*);
void set_lpass(char*);
char* get_luid();
char* get_lpass();
};
#endif
login.cpp
#include<cstring>
#include "login.h"
using namespace std;
void login::set_luid(char* rluid)
{
luid=new char[30];
strcpy(luid,rluid);
}
void login::set_lpass(char* rpass)
{
lpass=new char[30];
strcpy(lpass,rlpass);
}
char* login::get_luid()
{
return luid;
}
char* login::get_lpass()
{
return lpass;
}
controller.h
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "registration.h"
#include "login.h"
class control
{
public:
void casino_game();
void cgregister(registration &);
//int cglogin(login &);
};
#endif
controller.cpp
#include<iostream>
#include "controller.h"
#include "ui.h"
#include "registration.h"
#include "login.h"
#include "db.h"
using namespace std;
void control::casino_game()
{
ui uiobj;
registration R;
login lo;
db dbobj;
int loop=1;
int l;
uiobj.mainui();
int choice=uiobj.get_choice();
while(loop==1)
{
switch(choice)
{
case 1:
uiobj.set_details(R);
dbobj.cgregister(R);
loop=2;
break;
case 2:
uiobj.set_login(lo);
l=dbobj.cglogin(lo);
cout<<l;
loop=2;
break;
case 3:
exit(1);
break;
default:
cout<<"\nInvalid Choice";
}
uiobj.mainui();
loop=1;
choice=uiobj.get_choice();
}
}
db.h
#include "registration.h"
#include "login.h"
class db{
public:
int dbconnect();
int cgregister(registration &);
int cglogin(login &);
};
ui.h
#ifndef UI_H
#define UI_H
#include "registration.h"
#include "login.h"
class ui{
public:
void mainui();
void set_details(registration &);
void set_login(login &);
int get_choice();
};
#endif
Please help me as soon as possible......