这是我的代码。为什么“第一次”没有找到?
.h文件
/*
* Student.h
*
* Created on: Jan 28, 2016
* Author: Clint Sullivan
*/
#ifndef STUDENT_H_
#define STUDENT_H_
#include <iostream>
#include <string>
using namespace std;
class Student {
struct Address{
string street;
string city;
string state;
string zipcode;
};
private:
int eid;
string first;
string last;
Address campusAddress;
Transcript transcript;
public:
Student();
int getEID() const;
string getFirst() const;
string getLast() const;
Address getCampusAddress() const;
Transcript getTranscript() const;
void setEid(const int eid);
void setFirst(const string& first);
void setLast(const string& last);
void setCampusAddress(const Address& campusAddress);
void setTranscript(const Transcript& transcript);
string toString() const;
};
/* namespace std */
#endif /* STUDENT_H_ */
.cpp文件:
/*
* Student.cpp
*
* Created on: Jan 28, 2016
* Author: Clint Sullivan
*/
#include <sstream>
#include "Student.h"
using namespace std;
struct Address;
Student::Student()
{
}
string Student::getFirst() const {return first; } //member declaration not found, symbol 'first' could not be resolved
任何建议?
答案 0 :(得分:0)
您在Student类的私有部分中定义了Transcipt类型变量,但是我无法看到您在哪里定义了transcript结构/类?