#include <stdio.h>
int testf();
typedef int (*F2)();
int a = 5;
int *f1();
void main()
{
F2 f2;
f2 = &testf;
int a = f2();
int *p = f1();
}
int testf()
{
return 1;
}
int *f1()
{
return &a;
}
博客展示了一段C语言代码,包含头文件引入、函数定义、类型定义等。定义了testf和f1函数,在main函数中进行函数指针赋值和调用,还涉及变量的使用和指针操作。
#include <stdio.h>
int testf();
typedef int (*F2)();
int a = 5;
int *f1();
void main()
{
F2 f2;
f2 = &testf;
int a = f2();
int *p = f1();
}
int testf()
{
return 1;
}
int *f1()
{
return &a;
}

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