본문 바로가기

카테고리 없음

포인터함수

#include <iostream>   
using namespace std;

int Print()   
{   
    cout << "just test" << endl;   
return 0;
}   
  
int main( void )   
{      
    // 함수 포인터 변수 선언 및 대입.   
    //typedef void (*FuncPtr)( void );       
    //FuncPtr pFunc = Print;   
  
    // typedef 를 안쓴다면..   
     int (*pFunc)( void ) = Print;      
  
    // 함수 호출.   
    //pFunc();    
if((*pFunc)()==0)
cout << "ok" << endl;

  
    return 0;   
}