« サッカー合宿 | メイン | 神経衰弱(トランプの) »
2005年10月 5日
関数のポインタ
関数のポインタを利用して、その関数をコールする事が可能。
・プロトタイプ宣言
bool (*pFunction)(int, long);
・実装
pFunction = CompValue;
:
:
if ((*pFunction)(10, 20) == true) {
:
:
}
:
bool CompValue(int iValue, long lValue)
{
if (iValue < lValue) {
return false;
} else {
return true;
}
}
投稿者 danna : 2005年10月 5日 15:43
トラックバック
このエントリーのトラックバックURL:
http://www.namibuta.net/cgi-bin/mt/mt-tb.cgi/354