Function Does Not Take 3 Arguments

Okay, so basically I'm trying to allow the user to talk to NPCs in the room and when they do, it'll read text in from the .txt file (depending on what room they're in, or what NPC they talk to).

Using: Microsoft Visual Studio 2010 Express C++, Windows 7 OS.

9 times out of 10 I can fix errors myself, but not this one - I've searched around on the internet for others with a similar problem but I lack the experience to apply their solution to a different scenario in coding.

And with that, here's the code:

Header File
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef _MAIN_H
#define _MAIN_H

#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
using namespace std;

#define GAME_FILE "Replacement.txt"

#define MAX_LOOKS		3

#define STILL_PLAYING	1
#define QUIT			0

#define PLAYER_ALIVE	1
#define PLAYER_DEAD		0

///////////////////////////////////// PLAYER CLASS
class CPlayer
{
public:
	void SetName(string strPlayerName)			{ m_strName = strPlayerName; 	 }
	void SetHealth(int playerHealth)			{ m_health = playerHealth;	 }
	void SetWeapon(string strPlayerWeapon)		        { m_strWeapon = strPlayerWeapon; }
	void SetDamage(int playerDamage)			{ m_damage = playerDamage;	 }

	string GetName()	const					{ return m_strName;	}
	string GetWeapon()	const					{ return m_strWeapon;	}

	int GetDamage()		const					{ return m_damage; }
	int GetHealth()		const					{ return m_health; }
	
	///////////////////////////////////// NPC STUFF

	void SetNPCName(string strNPCName)			{ m_strNPCName = strNPCName; }		
	void SetNPCText(string strNPCText)			{ m_strNPCText = strNPCText; }
	
	string GetNPCName()							{ return m_strNPCName;		 }	
	string GetNPCText()							{ return m_strNPCText;		 }

	///////////////////////////////////// NPC STUFF

private:
	string m_strName;		
	string m_strWeapon;		
	
	int m_health;			
	int m_damage;			

	///////////////////////////////////// NPC STUFF

	string m_strNPCName;	
	string m_strNPCText;	


	///////////////////////////////////// NPC STUFF

};

///////////////////////////////////// MONSTER CLASS
class CMonster
{
public:
	void SetName(string strMonsterName)			{ m_strName = strMonsterName; }
	void SetAttackMessage(string strMessage)		{ m_strAttackMessage = strMessage; }
	void SetHealth(int monsterHealth)			{ m_Health = monsterHealth; }
	void SetDamage(int monsterDamage)			{ m_Damage = monsterDamage; }

	string GetName()			const				{ return m_strName; }
	string GetAttackMessage()	        const				{ return m_strAttackMessage; }

	int GetHealth()				const				{ return m_Health; }
	int GetDamage()				const				{ return m_Damage; }
	
private:
	string m_strName;			
	string m_strAttackMessage;	
	int m_Health;				
	int m_Damage;				

};

///////////////////////////////////// ROOM STRUCTURE
struct tRoom
{
	string strCurrentRoom;	
	string strRoomDescription;	
	string strRoomNorth;	
	string strRoomEast;	
	string strRoomSouth;	
	string strRoomWest;	
	string strLookArray[MAX_LOOKS];	
	string strLookDescription;
	
	CMonster monster;					
	bool bMonsterInRoom;				
	
	/////////////////////////////////////
	
	string strTalkArray[MAX_LOOKS];	
	string strNPCText;					

	/////////////////////////////////////

};



#endif


Main Source Code (also where the error lies)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
///////////////////////////////////// CHECK (TEXT) NPC

bool CheckNPC(tRoom &room, string strNPC)
{
	
	for(int i = 0; i < MAX_LOOKS; i++)			
	{
	
		if(strNPC == room.strTalkArray[i])
		return true;
	
	}

	return false;
}

///////////////////////////////////// GET TEXT INFO

void GetText(ifstream &fin, tRoom &room, CPlayer &player, string strInput)
{
	string strLine = "";

	fin.seekg(NULL,ios::beg);
	fin.clear();

	while(getline(fin, strLine, '\n'))
	{
		if(strLine == "<" + room.strCurrentRoom + "|" + strInput + ">")
		{
			getline(fin, room.strNPCText, '*');
			return;											
		}
	}
															
}

///////////////////////////////////// DISPLAY NPC TEXT

void DisplayNPCText(string strNPCText)
{
	cout << endl << strNPCText << endl;
}


///////////////////////////////////// GET INPUT

int GetInput(ifstream &fin, tRoom &room, CPlayer &player)
{

	string strInput;
	string strLine;

	cout << endl << ": ";
	cin >> strInput;

	if(strInput == "look")				
	{
		DisplayRoom(room); 
	}
	
	else if(strInput == "view")
	{

		cout << "What do you want to view?" << endl;
		cin >> strInput;

			if(CheckLook(room, strInput))			
			{ 
				GetLookInfo(fin, room, strInput);
				DisplayLook(room.strLookDescription);		  
			}
			else						{ cout << "There is no such thing to look at..." << endl; }
	}

	else if(strInput == "status")				{ DisplayPlayer(player);					 }
	else if(strInput == "north")				{ Move(fin, room, room.strRoomNorth);		 }
	else if(strInput == "east")				{ Move(fin, room, room.strRoomEast);		 }
	else if(strInput == "south")				{ Move(fin, room, room.strRoomSouth); 		 }
	else if(strInput == "west")				{ Move(fin, room, room.strRoomWest);		 }
	else if(strInput == "quit")				{ cout << "Quitting already?"; return QUIT;  }
	else if(strInput == "help")				{ cout << "Console commands: Look, View, Status, North, East, South, West, Quit, Help, Talk, Save/Load." << endl; }

	//////////////////////////////// NEW //////////////////////////////// NEW
	else if(strInput == "talk")			
	{ 
		cout << "Who do you want to talk to?" << endl << ": ";
		cin >> strInput;
		
			if(CheckNPC(room, strInput))			
			{ 
				GetText(fin, room, strInput);
				DisplayNPCText(room.strNPCText);
			}
			else						{ cout << "There is no such person to talk to..." << endl; }

	}

	//////////////////////////////// NEW //////////////////////////////// NEW

	else								{ cout << "Invalid command." << endl;		 }

	return STILL_PLAYING;
	
}


The error I get is this: (note the line should actually be 91 as I'm not including every other line of code)
1
2
3
1>  Main.cpp
1>c:\main.cpp(287 **should be 91 as I mentioned above**): error C2660: 'GetText' : function does not take 3 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


So, basically, I have no idea how to fix this (I'm still quite new to programming) and would GREATLY appreciate any tips, advice, or fixes to this error. If there's any questions, or you need me to clarify something, please post, I will be more than happy to assist you with assisting me :)

Thanks.
Last edited on
on line 19, you declare GetText() to take 4 arguments, but on line 91, you only pass 3.
Ahhhh ok, so that's my problem. Thanks!
Topic archived. No new replies allowed.