error C2664

I'm having trouble with this part of my code and I don't know why. Maybe one of you guys could help me?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
void Stats::displayStats(int *aPlayer)
{
	if(aPlayer = 0) //error
		firstTime(0);

	cout << "you got this far!\n";
	
}

void Stats::firstTime(int *fristTime)
{
	if(fristTime = 1) //error
		displayStats(1);
...


Error:
error C2440: '=' : cannot convert from 'int' to 'int *'

Thanks,
-Jolt
Last edited on
Line 3: It's ==, not =. Also, *aPlayer, not aPlayer.
Line 4: I smell infinite recursion in the air.
Line 12: See line 3.
Line 13: It smells like foul eggs. Don't pass literal constants other than zero to functions taking pointers.

Why do the functions take pointers, anyway? You're not changing the variables they point to.
On the conditional tests, you need to use == instead of =. Try this.
Hey helios, you submited ate the same minute as me.....
Topic archived. No new replies allowed.