Quick not declared in scope error

I am sure I am just overlooking something simple but I can't figure it out. Here is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __UPDATER_H__
#define __UPDATER_H__

#include "market.h"
#include "operation.h"
#include "history.h"
#include "bank.h"
#include <cmath>
#include <cstring>
#include <cassert>
#include <fstream>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <ctime>
#include <cstdio>

using namespace std;

struct execNextDay
{
	int numDays;
};

struct returnFinAssets
{
	double amtGold;
	double amtSilv;
	double amtPlat;
	double money;
};


class updater
{
	public:
	updater();
	~updater();
	int nextDay(execNextDay order);
	returnFinAssets finAssets();

	private:
	int day;
	market mkt;
	operation ops;
	history hist;
	bank bnk;

};

#include "updater.cpp"
#endif 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//Member functions for bank class

#include "updater.h"

updater::updater()
{
	day = 0;
}

updater::~updater()
{


}

int nextDay(execNextDay order)
{
	cout << "\n\nDay " << day << endl << endl;
	day=day+order.numDays;

}

returnFinAssets finAssets()
{
	returnFinAssets reply;
	reply.amtGold = mkt.amtGold;
	reply.amtSilv = mkt.amtSilv;
	reply.amtPlat = mkt.amtPlat;
	reply.money = mkt.money;
	return returnFinAssets;
}
	


Here's the errors:

updater.cpp: In function ‘int nextDay(execNextDay)’:
updater.cpp:18: error: ‘day’ was not declared in this scope
updater.cpp: In function ‘returnFinAssets finAssets()’:
updater.cpp:26: error: ‘mkt’ was not declared in this scope
updater.cpp:30: error: expected primary-expression before ‘;’ token


Thanks
You forgot updater:: in front of your method names.
Yes I did. Thanks.

Also just noticed the other error. It's all good now.
And delete line 51. Never include source files.
Topic archived. No new replies allowed.