这些天,在poco c++中阅读代码,发现类中定义了main函数;第一次看到这样的用法,但没有查到这样写的意义和目的,难道像java那样写,自己写了个代码,可以供大家参考:
#include <iostream>
#include <stdio.h>
using namespace std;
class test
{
public:
int main()
{
puts( "test::main hehe" );
return 0;
}
};
int main()
{
test x;
x.main();
} 如果有知道这个写法,请指教.
转载于:https://blog.51cto.com/qtlinux/1698976

2747

被折叠的 条评论
为什么被折叠?



