I am trying to use the "UserAccType" in "UserAccountListType" but the code keeps giving me this error: symbol(s) not found for architecture x86_64. I have tried to use forward declaration and it gave me another error: "field has incomplete type". how to fix this problem and thanks in advance.
Here is a piece of the code:
//UserAccountListType.h
#ifndef USERACCOUNTLISTTYPE_H
#define USERACCOUNTLISTTYPE_H
#include <iostream>
class UserAccType;
class UserAccountNode;
class UserAccountListType
{
private:
UserAccountNode *first;
UserAccountNode *last;
int counter;
public:
UserAccountListType()
{
first = last = NULL;
counter = 0;
}
void destroyList();
void print() const;
void insertUserAccount(const UserAccType newItem);
void deleteUserAccount(std::string ud);
void printInfoOfUserId(std::string userId);
bool isUserIdExist(std::string ud);
~UserAccountListType()
{
destroyList();
}
};
#endif
//UserAccType.h
#include <iostream>
#ifndef USERACCTYPE_H
#define USERACCTYPE_H
class UserAccType
{
private:
std::string userId;
std::string password;
std::string firstName;
std::string lastName;
std::string encryptedPassword;
public:
UserAccType(std::string userId = "", std::string password = "", std::string firstName = "", std::string lastName = "")
{
this->firstName = firstName;
this->lastName = lastName;
this->password = password;
this->userId = userId;
}
void setUserId(std::string);
void setpassword(std::string);
void setFirstName(std::string);
void setLastName(std::string);
std::string getUserId();
bool isCompleteUserACC();
std::string encryptPassword(std::string);
void printUserInfo();
bool isValidPassword(std::string Password);
};
#endif