I am working on a project and i have three header files each defining a seperate struct with some function for accessing the variables this is an example of the student struct:
#include<string.h>
//using namespace std;
struct student
{
int studentId;
string fname;
string lname;
};
void SetId(student * stu,int id)
{
stu->studentId=id;
}
void SetFirstName(student * stu,string name)
{
stu->fname=name;
}
void SetLastName(student * stu,string name)
{
stu->lname=name;
}
int GetId(student * stu)
{
return stu->studentId;
}
string GetFirstName(student * stu)
{
return stu->fname;
}
string GetLastName(student * stu)
{
return stu->lname;
}
when i compile this file i get two errors: 1. [Error] unknown type name 'string' 2. [Error] unknown type name 'student'