📄 ptr.c
字号:
/* Demonstration of declaring and using a pointer to a function.*/
#include <stdio.h>
/* The function prototype. */
double square(double x);
/* The pointer declaration. */
double (*ptr)(double x);
int main( void )
{
/* Initialize p to point to square(). */
ptr = square;
/* Call square() two ways. */
printf("%f %f\n", square(6.6), ptr(6.6));
return 0;
}
double square(double x)
{
return x * x;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -