在这里,我们将看到什么是__func__C。
基本上是__func__或__FUNCTION __(某些旧版本的C和C ++支持__func__)。该宏用于获取当前函数的名称。
#include<stdio.h>
void TestFunction(){
printf("Output of __func__ is: %s\n", __func__ );
}
main() {
printf("Output of __func__ is: %s\n", __func__ );
TestFunction();
}输出结果
Output of __func__ is: main Output of __func__ is: TestFunction