Message passing help

I am creating a program named PosterRUs for my assignment which consists of the following classes:

Customer, Order, Paper, Poster.

The order class will have customer, paper and poster messaged passed into it but whenever I attempt to do this it keeps saying "declaration is incompatible with double..".

Let me show you the code:


Order.cpp:

#include "Order.h"
#include "Paper.h"
#include "Poster.h"
#include "Customer.h"
#include <iostream>
#include <string>

using namespace std;

Order::Order(Poster _poster, Paper _paper, Customer _customer)
:poster(_poster), paper(_paper), customer(_customer)
{

}


Poster Order::TotalCost(){

}


void Poster::Display(){

cout << "Hi" << endl;
}

Order.h:

#ifndef ORDER_H
#define ORDER_H
#include "Customer.h"
#include "Paper.h"
#include "Poster.h"

#include <string>

using std::string;

class Order{

private:

Poster poster;
Paper paper;
Customer customer;

public:

Order(Poster, Paper, Customer);

double CalculateNormalPosterCost();

//double CalculateExtraPosterCost();

//double TotalCost();

void Display();



};

#endif
Last edited on
You haven't shown us where you instantiate the Order class. That is apparently where your problem is.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

Topic archived. No new replies allowed.