【发布时间】:2020-02-18 17:42:32
【问题描述】:
编辑:为之前的混乱道歉。
我遇到了一个类似
的代码示例 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[])
{
int num = (round)(3.14*2 / 1.618);
printf("test %d test", num);
int num2 = (round)(3.0 / 2.0);
printf("test %d test", num2);
}
这个(圆形)有什么作用?这是对 math.h 中 round 函数的函数调用吗?这是否意味着我在(圆形)指针的位置有效地调用了一个函数?这是否意味着 (myFun+1)(myVar) 在某些情况下可以工作?
【问题讨论】:
-
某处,您应该可以找到
typedef .... round;显示该代码的详细信息。round可能是在某处定义的函数指针。 -
它可能会强制调用函数而不是扩展宏。
-
我不知道这个,但是
(printf)("abc\n");使用 MSVC 编译和运行。 -
@WeatherVane
(*printf)("abc\n");也应该可以正确编译和运行。 -
@IanAbbott 甚至
(*************printf)("abc\n");
标签: c