Hi out there.
I can't get the constructors in my header files to work.
Here's a copy of my header file code:
#ifndef GUARD_PHEADER_H
#define GUARD_PHEADER_H
//The header file for the Person.cpp.
//person_header.h
#include <iostream>
#include <string>
//Person class declaration
class Person {
public:
std::istream& read_surname(std::istream&);
std::istream& read_name(std::istream&);
std::istream& read_phone(std::istream&);
std::istream& read_age(std::istream&);
std::istream& read_weight(std::istream&);
std::string& read_phone(std::string&);
int& read_age(int&);
double& read_weight(double&);
std::string get_name() const { return name; }
std::string get_surname() const { return surname; }
std::string get_phone() const { return phone; }
int get_age() const { return age; }
double get_weight() const { return weight; }
person(std::string&, std::string&, std::string&, int&, double&);
Person(std::ifstream&);
private:
std::string surname;
std::string name;
std::string phone;
int age;
double weight;
};
#endif
And a copy of the function code:
//Constructor for Person
Person::person(std::ifstream& in) : surname(0), name(0), phone(0), age(0), weight(0.0) { }
//Constructor for Person
Person::person(): surname(0), name(0), phone(0), age(0), weight(0.0) { }
I keep getting all the weird errors that you can find in my compile log. I'm running Dev C++ on Windows XP.
Thanx:cheesy:
Steven