StartUp启动代码体会,隐藏Console main 函数
2011-07-10 01:25
106 查看
// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include"main.h"
#include<stdlib.h>
#pragma comment(lib,"main.lib")
void MyFuction();
void MyFunction1();
class student
{
public:
student()
{
printf("student\n");
pfn = MyFuction;
}
};
student st;
void MyFunction1()
{
printf("myfunction1\n");
}
void MyFuction()
{
printf("hello");
system("pause");
}
//==================================mian ib 库函数 ===============================//
//main.cpp
#include"stdafx.h"
#include"main.h"
#include<stdlib.h>
void(*pfn)() = NULL;
int main()
{
if(pfn!=NULL)
pfn();
printf("hide main function");
system("pause");
return 0;
}
//main.h
#include"stdafx.h"
extern "C" void(*pfn)();#include"stdafx.h"
extern "C" void(*pfn)();
运行结果截图
//
#include "stdafx.h"
#include"main.h"
#include<stdlib.h>
#pragma comment(lib,"main.lib")
void MyFuction();
void MyFunction1();
class student
{
public:
student()
{
printf("student\n");
pfn = MyFuction;
}
};
student st;
void MyFunction1()
{
printf("myfunction1\n");
}
void MyFuction()
{
printf("hello");
system("pause");
}
//==================================mian ib 库函数 ===============================//
//main.cpp
#include"stdafx.h"
#include"main.h"
#include<stdlib.h>
void(*pfn)() = NULL;
int main()
{
if(pfn!=NULL)
pfn();
printf("hide main function");
system("pause");
return 0;
}
//main.h
#include"stdafx.h"
extern "C" void(*pfn)();#include"stdafx.h"
extern "C" void(*pfn)();
运行结果截图
相关文章推荐
- StartUp启动代码体会,隐藏Console main 函数
- VxWorks启动代码romStart()函数分析
- Pixhawk之启动代码和入口函数(.mk、rcS、__start、hrt)
- Pixhawk之启动代码和入口函数(.mk、rcS、__start、hrt)
- startup_stm32f10x_xx.s 启动代码文件选择
- VxWorks启动代码usrInit()函数分析
- VxWorks启动代码usrInit ()函数分析
- 可以在CR t0.c文件中找到这4个启动函数的代码
- startup_stm32f10x_hd.s启动代码分析
- startup_stm32f10x_xx.s 启动代码文件选择
- Vxworks启动代码usrRoot()函数分析(一)
- C51 main()函数和启动代码 --- 从汇编到c51
- VxWorks启动代码romStart()函数分析
- Linux内核启动代码之__create_page_tables函数分析
- Linux 启动代码 Start_kernel()函数分析
- [ARM] Cortex-M Startup.s启动文件相关代码解释
- Vxworks启动代码usrRoot()函数分析(二)
- Vxworks启动代码usrRoot()函数分析(一)
- VxWorks启动代码usrInit()函数分析
- [ARM] Cortex-M Startup.s启动文件相关代码解释