作者在 2010-07-24 22:12:44 发布以下内容
//--- 借用宏定义实现
#include <stdio.h>
int Function_2()
{
return 2;
}
int Function_1()
{
return 1;
}
int main( int ac, char **av )
{
printf("stub test:%d\n", Function_1());
#define Function_1 Function_2
printf("stub test:%d\n", Function_1());
#undef Function_1
printf("stub test:%d\n", Function_1());
return 0;
}
#include <stdio.h>
int Function_2()
{
return 2;
}
int Function_1()
{
return 1;
}
int main( int ac, char **av )
{
printf("stub test:%d\n", Function_1());
#define Function_1 Function_2
printf("stub test:%d\n", Function_1());
#undef Function_1
printf("stub test:%d\n", Function_1());
return 0;
}