0

Here is my code. Why is 'first' not being found?

.h file

/*
 * 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 file:

/*
  * 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

Any Suggestions?

Naeem Ul Wahhab
  • 2,465
  • 4
  • 32
  • 59
  • After fixing `Transcript` not existing in your code, I [can't reproduce the problem](http://coliru.stacked-crooked.com/a/b1d73d6520ae4f0f). Please post a [mcve]. – chris Jan 29 '16 at 00:05
  • Googling your error I get: http://stackoverflow.com/a/15532166/2475059 Are you using Eclipse? – user2475059 Jan 29 '16 at 00:57

1 Answers1

0

you define a Transcipt type variable in the private section of the Student class, but I can't see where you have defined the transcript struct/class?

joshpj1
  • 186
  • 1
  • 1
  • 9