I am practicing with OOP in C++. The problem I am working on requires 2 classes, one for a patient and another for a medical procedure performed. I wrote a header and class implementation file for the patient class. The header file compiled without a problem, but for some reason the .cpp
file keeps giving me:
undefined reference to 'winmain'. Error ID returned 1 exit status.
I am new to OOP, and have already tried reviewing the book required for class and searching for the answer to no avail.
Header file:
#ifndef Patient_h
#define Patient_h
#include <string>
using std::string;
class Patient
{
private:
string name, address, phone, e_contact;
public:
Patient(string n = " ", string a = "", string p = "", string e_con = "")
{
name = n; address = a; phone = p; e_contact = e_con;
}
void setName();
void setAddress();
void setPhone();
void setContact();
string getName();
string getAddress();
string getPhone();
string getContact();
};
#endif
And the cpp file:
#include "Patient.h"
#include <iostream>
using std::cout; using std::cin;
void Patient::setName()
{
cout << "Enter the Patient's full name. First, middle and last.\n";
getline(cin, name);
cin.ignore();
}
void Patient::setAddress()
{
cout << "Enter the Patient's address. Street, city and state + zipcode.\n";
getline(cin,address);
cin.ignore();
}
void Patient::setPhone()
{
cout << "Enter the patient's phone number.\n";
getline(cin,phone);
cin.ignore();
}
void Patient::setContact()
{
cout << "Please enter the patient's emergency contact name and phone.\n";
getline(cin, e_contact);
cin.ignore();
}
string Patient::getName()
{
return name;
}
string Patient::getAddress()
{
return address;
}
string Patient::getPhone()
{
return phone;
}
string Patient::getContact()
{
return e_contact;
}