如何将其他函数设置为程序入口点

来源:互联网 发布:上海企浩 网络推广 编辑:程序博客网 时间:2024/06/05 18:19

如何将其他函数设置为函数入口

第一步:工程属性-----链接器-----系统-----子系统下选择控制台(/SUBSYSTEM:CONSOLE).

第二步:编辑代码

#include<iostream>

#pragma comment(linker,"/entry:FunTest")//预处理指令 ; FunTest是作为入口函数的函数名
using namespace std;
void  FunTest ()//定义作为入口的函数
{
cout<<"hello"<<endl;

return;
     
}

这样FunTest()就可以作为程序的入口函数了。

 

0 0