有人可以帮我解释这个宏吗?

编程入门 行业动态 更新时间:2024-10-27 04:38:09
本文介绍了有人可以帮我解释这个宏吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

#define D(y ...)(const int []){y} 我的理解是D正在接受各种长度参数y 这是一个const int数组。我是对的吗? 谢谢。

#define D(y...) (const int []) {y} My understand is that D is taking in a various length parameter y which is an array of const int. Am I right? Thanks.

推荐答案

11月13日,12:46 * pm," ; webinfin ... @ gmail" < webinfin ... @ gmail> 写道: On Nov 13, 12:46*pm, "webinfin...@gmail" <webinfin...@gmail> wrote: #define D(y ...)(const int [ ]){y} 我的理解是D正在接受各种长度参数y 这是一个const int数组。我对吗? #define D(y...) (const int []) {y} My understand is that D is taking in a various length parameter y which is an array of const int. Am I right?

这是语法错误。你确定你正确地转录了 吗?

This is a syntax error. Are you sure you transcribed it correctly?

Old Wolf写道: Old Wolf wrote: 11月13日下午12:46,webinfin ... @ gmail < webinfin ... @ gmail> 写道: On Nov 13, 12:46 pm, "webinfin...@gmail" <webinfin...@gmail> wrote: > #define D(y ...)(const int []){y} 我的理解是D正在接受各种长度参数y 这是一个const int数组。我对吗? >#define D(y...) (const int []) {y}My understand is that D is taking in a various length parameter ywhich is an array of const int. Am I right?

这是语法错误。你确定你正确地转录了 吗?

This is a syntax error. Are you sure you transcribed it correctly?

对我而言,它看起来像是新C标准的可变宏,而不是C ++标准中的。

To me it looks like a variadic macro from the newer C standard, not yet in the C++ standard.

我们********* @ gmail 写道: #define D(y ...)(const int []){y} 我的理解的是D是一个各种长度参数y 这是一个const int数组。我是对的吗? #define D(y...) (const int []) {y} My understand is that D is taking in a various length parameter y which is an array of const int. Am I right?

尝试clc,这看起来像C99。 - 伊恩柯林斯

Try c.l.c, this looks like C99. -- Ian Collins

更多推荐

有人可以帮我解释这个宏吗?

本文发布于:2023-06-13 09:40:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/679105.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帮我

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!