Cannot convert argument

Hi,
I'm fighting with an error in my cpp project (content and some words are in polish, but I think those parts are redundant).

This is the main part of the code that causes this error:

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
...
	int arrN[] = { 100, 500, 968, 1000, 2000, 3000, 5000 };
	int nSize = sizeof(arrN[0])/sizeof(int);
	cout << "Jacobi:" << endl;
	for (int i = 0; i < nSize; i++) {
		Rownanie X(arrN[i]);
		cout << "N = " << arrN[i] << " czas: " << countTime(X, &Rownanie::initA, &Rownanie::metodaJacobiego) << "s" << endl;
	}
	cout << endl << "Gauss-Seidl:" << endl;
	for (int i = 0; i < nSize; i++) {
		Rownanie X(arrN[i]);
		cout << "N = " << arrN[i] << " czas: " << countTime(X, &Rownanie::initA, &Rownanie::metodaGaussaSeidla) << "s" << endl;
	}
	cout << endl << "LU:" << endl;
	for (int i = 0; i < nSize; i++) {
		Rownanie X(arrN[i]);
		cout << "N = " << arrN[i] << " czas: " << countTime(X, &Rownanie::initA, &Rownanie::metodaLU) << "s" << endl;
	}
	return 0;
}

float countTime(Rownanie& eq, void(Rownanie::* initF)(), double(Rownanie::* methodF)()) 
{
	(eq.*initF)();
	int start = clock();
	cout << "Norma: " << (eq.*methodF)() << ". ";
	return (float)(clock() - start) / CLOCKS_PER_SEC;
}



And this is the error I get when I try to call function countTime():
 
Error	C2664	'float liczCzas(Rownanie &,void (__thiscall Rownanie::* )(void),double Rownanie::* )': cannot convert argument 3 from 'double (__thiscall Rownanie::* )(void)' to 'double Rownanie::* '


Maybe I'm sitting for too long on this error, but I have no idea how to fix this... Please, is there something this easy that I can't see?

Thanks in advance...
> float countTime(Rownanie& eq, void(Rownanie::* initF)(), double(Rownanie::* methodF)())
But how is it declared in your header file, or wherever you prototype it before you try to call it.
Topic archived. No new replies allowed.