<分区>
基本上我在互联网上发现的问题是:“我们如何在不使用循环和条件的情况下打印从 1 到 100 的数字?”在答案中,我卡在了下面标有粗体的几行。谁能给我解释一下那是什么? 据我所知,我认为下面的全部代码都是用 C 语言编写的。
#include <stdio.h>
#include <stdlib.h>
void foo(int);
void f1(int x)
{
printf ("%d\n", x + 1);
foo (x + 1);
}
void f2(int x) //why we have used this fumction
{}
void (*tab[])(int) = { f1, f2 }; // what is this
void foo(int x)
{
tab[!(x < 100)](x); // what is this
}
int main()
{
foo(0);
return 0;
}