为什么是“数组"?在 Visual-C++ 中标记为保留字? [英] Why is "array" marked as a reserved word in Visual-C++?

查看:47
本文介绍了为什么是“数组"?在 Visual-C++ 中标记为保留字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio 语法高亮显示该词为蓝色,就好像它是关键字或保留词一样.我尝试在网上搜索它,但是数组"这个词让搜索失败了,我得到的大部分页面都解释了什么是数组.有什么用?

解决方案

它不是 ISO 标准下的保留字.Microsoft 的 C++/CLI 定义了 arraycli 命名空间,Visual Studio 的语法高亮会将其视为保留字.这种用法将被视为供应商扩展,而不是任何国际 C 或 C++ 标准的一部分.

ISO C99 关键词:><前>自动枚举限制无符号打破外部返回无效案例浮动短易失性签名时的字符const 转到 sizeof _Bool如果静态 _Complex 则继续默认内联结构 _Imaginary做 int switch双长类型定义否则注册工会

ISO C++98 关键字:

<前>加倍不是这个and_eq dynamic_cast not_eq throwasm else 运算符 true自动枚举或尝试bitand 显式 or_eq typedefbitor 导出私有 typeidbool extern 受保护的类型名打破虚假公会case 浮点寄存器无符号捕获 reinterpret_cast 使用字符朋友返回虚拟类转到短无效compl 如果签名为 volatileconst inline sizeof wchar_tconst_cast int static while继续 long static_cast xor默认可变结构 xor_eq删除命名空间开关做新模板

Visual Studio syntax highlighting colors this word blue as if it were a keyword or reserved word. I tried searching online for it but the word "array" throws the search off, I get mostly pages explaining what an array is. What is it used for?

解决方案

It's not a reserved word under ISO standards. Microsoft's C++/CLI defines array in the cli namespace, and Visual Studio's syntax highlighting will treat it as a reserved word. This usage would be considered a vendor extension and not a part of any international C or C++ standard.

ISO C99 Keywords:

auto        enum        restrict    unsigned
break       extern      return      void
case        float       short       volatile
char        for         signed      while
const       goto        sizeof      _Bool
continue    if          static      _Complex
default     inline      struct      _Imaginary
do          int         switch
double      long        typedef
else        register    union

ISO C++98 Keywords:

and         double          not                 this 
and_eq      dynamic_cast    not_eq              throw 
asm         else            operator            true 
auto        enum            or                  try 
bitand      explicit        or_eq               typedef 
bitor       export          private             typeid 
bool        extern          protected           typename 
break       false           public              union 
case        float           register            unsigned 
catch       for             reinterpret_cast    using 
char        friend          return              virtual 
class       goto            short               void 
compl       if              signed              volatile 
const       inline          sizeof              wchar_t 
const_cast  int             static              while 
continue    long            static_cast         xor 
default     mutable         struct              xor_eq
delete      namespace       switch     
do          new             template

这篇关于为什么是“数组"?在 Visual-C++ 中标记为保留字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆