Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "array" marked as a reserved word in Visual-C++?

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?

like image 376
CS student Avatar asked Dec 16 '08 20:12

CS student


People also ask

Is array a reserved word in C?

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.

Is array a key word?

from my knowledge "array" is not a keyword, so therefore you could not use it to declare an array.

Is array a valid identifier?

array is a valid identifier, but it certainly is discouraged because of the previous point.


1 Answers

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 
like image 135
11 revs, 3 users 78% Avatar answered Oct 07 '22 16:10

11 revs, 3 users 78%