So there are two classes in separate header files
Customer. h
using namespace std;
#include <iostream>
class Customer{
friend void Display();
private:
int number, zipCode;
public:
Customer(int N, int Z){
number = N;
zipCode = Z;
}
};
City. h using namespace std; #include #include "Customer.h"
class City{
friend void Display();
private:
int zipCode;
string city, state;
public:
City(int Z, string C, string S){
zipCode = Z;
city = C;
state = S;
}
};
my main.cpp is as follows
#include "City.h"
#include "Customer.h"
void Display(){
cout<<"Identification Number: "<<Customer.number<<endl
<<"Zip Code: "<<Customer.zipCode<<endl
<<"City: "<<City.city<<endl
<<"State: "<<City.state<<endl;
}
int main() {
Customer A(1222422, 44150);
City B(44150, "Woklahoma", "Kansas");
Display();
}
I'm good with the basics of c++ but this is where I Don't understand, so my specific question is.... Why for the four lines of my Display function does the compiler tell me "error: expected primary-expression before ‘.’ token"
Thanks in advance, Macaire