2 Star 2 Fork 0

SmithGoll/c语言学习

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
address-of-label_extension.c 548 Bytes
一键复制 编辑 原始数据 按行查看 历史
SmithGoll 提交于 2022-06-27 01:48 . 修改排版
#include<stdio.h>
#define COUNT 6
#define BEGIN goto begin
int i = COUNT;
int main()
{
static const void * goto_list[COUNT] =
{
&&hello0, &&hello1, &&hello2,
&&hello3, &&hello4, &&hello5
}; //address-of-label extension
begin:
while(i)
{
i--;
goto *goto_list[i];
}
return 0;
hello0:
printf("Hello,world!\n");
BEGIN;
hello1:
printf("Hello,gcc!\n");
BEGIN;
hello2:
printf("Hello,clang!\n");
BEGIN;
hello3:
printf("Hello,windows!\n");
BEGIN;
hello4:
printf("Hello,java!\n");
BEGIN;
hello5:
printf("Hello,linux!\n");
BEGIN;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/smithgoll/c-language-learning.git
git@gitee.com:smithgoll/c-language-learning.git
smithgoll
c-language-learning
c语言学习
master

搜索帮助