Shr*_*rey 3 c++ syntax
可能重复: 从本地范围返回值?
#include <stdio.h> int main() { int x = ({int a = 2; a;}); printf("%d\n", x); }
输出:2
Ada*_*eld 15
它是GCC提供的C/C++语言的非标准扩展,称为语句表达式.如果您尝试使用该-pedantic标志进行编译,您将收到警告"ISO C禁止在表达式中使用支撑组".它不是可移植代码,应尽可能避免使用.
-pedantic
归档时间:
15 年 前
查看次数:
199 次
最近记录: