I am getting external link errors with the static consts below. Couldn't figure out what to do, would appreciate help :)

// Declartion of Order class

class Order
{
	private:
		// all of the different combo #s
		int a, b, c, d;
		int e, f, g, h;
		int i, j ,k, l;
		int m, n, o, p;
		// prices information
		double tax, subTotal, total;
		static const double macValue, cheeseValue, qtrValue, dblqtrValue;
		static const double bntValue, angdelValue, angbcValue, angmsValue;
		static const double angcpbbqValue, clubValue, classicValue, bltValue;
		static const double sschknValue, selValue, nugValue, fofValue;
	public:
		Order(); // constructor
		~Order(); // destructor
		void changeOrder(int y, int x); // chage number of items for a certain item #
		void changeTax(int y); // change tax ammount
		void recalculateTotal();
};


// Declare constant values for prices
const double macValue = 5.50;
const double cheeseValue = 5.25;
const double qtrValue = 5.75;
const double dlbqtrValue = 6.50;
const double bntValue = 5.60;
const double angdelValue = 6.50;
const double angbcValue = 6.50;
const double angmsValue = 6.50;
const double andcpbbqValue = 6.75;
const double clubValue = 5.75;
const double classicValue = 5.25;
const double bltValue = 5.50;
const double sschknValue = 5.35;
const double selValue = 5.65;
const double nugValue = 5.75;
const double fofValue = 4.75;

Recommended Answers

All 2 Replies

You are just defining global const double variables. You need to use the same syntax as in methods, ie. const double A::member=3.0 .

Ah I had tried that before but it wasn't working, i forgot a ; at the end of the class though before. Thank you for the help :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.