cout "//OBJECTS

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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//Critter Caretaker
//Simulates caring for a virtual pet

#include <iostream>
using namespace std;

class Critter
{
public:
	Critter(int hunger = 0, int boredom = 0);
	void Talk();
	void Eat(int food = 4);
	void Play(int fun = 4);
private:
	int m_Hunger;
	int m_Boredom;

	int GetMood() const;
	void PassTime(int time = 1);
};

Critter::Critter(int hunger, int boredom):

	m_Hunger(hunger),
	m_Boredom(boredom)
{}


inline int Critter::GetMood() const
{
	return (m_Hunger + m_Boredom);
}

void Critter::PassTime(int time)
{
	m_Hunger += time;
	m_Boredom += time;
}

void Critter::Talk()
{
	cout << "I'm a critter and I feel ";

	int mood = GetMood();
	if (mood > 15)
	{
		cout << "mad.\n";
	}
	else if (mood > 10)
	{
		cout << "frustrated.\n";
	}
	else if (mood > 5)
	{
		cout << "okay.\n";
	}
	else
	{
		cout << "happy.\n";
	}

	PassTime();
}

void Critter::Eat(int food)
{
	cout << "Brrupp.\n";
	m_Hunger -= food;
}

int main()
{

}

For okay and Brrupp it say's //OBJECTS over it. It doesn't effect the program building but it shouldn't have a redline i.e error under it. Anyone know why? This isn't the full program it's not done yet but this is confusing me
NewCComer wrote:
For okay and Brrupp it say's //OBJECTS over it.
I don't understand what this means.

If you're using visual studio, you can try to delete the intellisense database file.
Sorry should've been specific when I hover over it, it's underlined red as if theres an error. I use Visual Studio with Visual Assist installed.
Last edited on
Have you tried deleting the intellisense database file?
Topic archived. No new replies allowed.