throwFunPtr

来源:互联网 发布:原油理财软件 编辑:程序博客网 时间:2024/06/06 17:07
// throwFunPtr.cpp : Defines the entry point for the console application.//#include "stdafx.h"typedef void (*VoidFun)();typedef int (*IntFun)();void myfun(){printf("Hello World!\n");}int myfun_int(){printf("myfun_int!\n");return 1;}int main(int argc, char* argv[]){try{//throw &myfun;throw &myfun_int;}//*catch(VoidFun e){e();}//*/catch(IntFun e_int){e_int();}return 0;}

原创粉丝点击