gpt4 book ai didi

C代码检测编译器是否允许注释嵌套

转载 作者:太空狗 更新时间:2023-10-29 15:14:21 26 4
gpt4 key购买 nike

这是我最近被问到的一个面试问题:

Write a C program which when compiled and run, prints out a message indicating whether the compiler that it is compiled with, allows /* */ comments to nest

该怎么做?

最佳答案

int noNesting = 0 /* /* */ + 1 // */
;

关于C代码检测编译器是否允许注释嵌套,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7214950/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com