PDA

View Full Version : error C2664 - Please Help


Arachno331
12-09-2007, 12:58 PM
error C2664: 'Village' : cannot convert parameter 1 from 'PLAYER *' to 'PLAYER'

This error keeps coming up - Here is the line of the code. I dont understand why the pointer is messing up.

#include "Library.h"

// CROSSROADS


//GLOBAL VARIABLES

bool dcomplete = false;
bool lcomplete = false;
bool mcomplete = false;
bool vcomplete = false;
bool sacomplete = false;
bool drcomplete = false;

PLAYER player;

bool Crossroads()
{
int choice = 0;

while (choice !=10)

{
cout << "\n\nYou stand at the centre of several paths branching\nand winding into the distance.\n";
cout << "\nTo the side you can see a battered wooden sign.\n\n";

cout << "Walking towards it, you begin to read what it says.\n\n";
cout << "1. Village Mok'Nathal\n";
cout << "2. Hunting Grounds\n";

if (!dcomplete)
cout << "3. Arathi Desert (QUEST)\n";

if (dcomplete && !lcomplete)
cout << "4. Lake Putrid (QUEST)\n";

if (lcomplete && !mcomplete)
cout << "5. Mt. Mjolnir (QUEST)\n";

if (mcomplete && !vcomplete)
cout << "6. Infernal Caverns (QUEST)\n";

if (vcomplete && !sacomplete)
cout << "7. Summoning Altar (QUEST)\n";

if (sacomplete && !drcomplete)
cout << "8. The Dark Realm (QUEST)\n";

cout << "10. Exit Game\n\n";

cout << ">";

cin >> choice;

cout << endl;

switch (choice)
{
case 1:
{
cout << "You walk into the town.";
Wait();
Village(&player);
break;
}
case 2:
{
//HuntingGrounds();
break;
}
case 3:
{
//if (!dcomplete)
//ArathiDesert();
break;
}
case 4:
{
//if (dcomplete && !lcomplete)
//LakePutrid();
break;
}
case 5:
{
//if (lcomplete && !mcomplete)
//MtMjolnir();
break;
}
case 6:
{
//if (mcomplete && !vcomplete)
//InfernalCaverns();
break;
}
case 7:
{
//if (vcomplete && !sacomplete)
//SummoningAltar();
break;
}
case 8:
{
//if (sacomplete && !drcomplete)
//DarkRealm();
break;
}
default: break;
}

}

return true;
}

Mwnciau
12-09-2007, 02:45 PM
Im guessing that the error is in the Village() function, since thats the only place where player is involved

Dunna
12-12-2007, 08:08 PM
You're passing a pointer to a something that wants an object reference. Example:


int Example(int village)
{
return village;
}

void main()
{
int ThisWillFail = 5;
Example(&ThisWillFail); // Generates your error because I'm passing a pointer
}