From WikiChip
Difference between revisions of "c/reserved keywords"
< c

m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''Reserved keywords''' in [[C]] are a set valid [[identifier]] names which are part of the grammar of C and therefore may not be used for anything but their intended purpose. That is, they may not be used as variable names, function names, or an any other type of identifiers. Just like all other identifier in [[C]], they are case sensitive.
+
{{c title|Reserved Keywords}}'''Reserved keywords''' in [[C]] are a set valid [[identifier]] names which are part of the grammar of C and therefore may not be used for anything but their intended purpose. That is, they may not be used as variable names, function names, or an any other type of identifiers. Just like all other identifier in [[C]], they are case sensitive.
  
 
The table below lists all keywords reserved by the C language.
 
The table below lists all keywords reserved by the C language.
Line 48: Line 48:
 
*_Complex<sup>1</sup>
 
*_Complex<sup>1</sup>
 
|
 
|
*[[generic selection - C|_Generic]]<sup>2</sup>
+
*{{C|_Generic}}<sup>2</sup>
 
*_Imaginary<sup>1</sup>
 
*_Imaginary<sup>1</sup>
 
*_Noreturn<sup>2</sup>
 
*_Noreturn<sup>2</sup>
*[[static assertions - C|_Static_assert]]<sup>2</sup>
+
*{{C|_Static_assert}}<sup>2</sup>
 
*_Thread_local<sup>2</sup>
 
*_Thread_local<sup>2</sup>
 
|}
 
|}
  
<sup>1</sup> - Keywords added in [[C99]].  
+
<sup>1</sup> - Keywords added in [[C99]]. <br />
 
<sup>2</sup> - Keywords added in [[C11]].
 
<sup>2</sup> - Keywords added in [[C11]].
  
Line 73: Line 73:
 
* _Alignof
 
* _Alignof
 
* _Atomic
 
* _Atomic
* [[generic selection - C|_Generic]]
+
* {{C|_Generic}}
 
* _Noreturn
 
* _Noreturn
* [[static assertions - C|_Static_assert]]
+
* {{C|_Static_assert}}
 
* _Thread_local
 
* _Thread_local
  
 
[[Category:C programming language]]
 
[[Category:C programming language]]

Latest revision as of 20:05, 7 January 2015

Reserved keywords in C are a set valid identifier names which are part of the grammar of C and therefore may not be used for anything but their intended purpose. That is, they may not be used as variable names, function names, or an any other type of identifiers. Just like all other identifier in C, they are case sensitive.

The table below lists all keywords reserved by the C language.

  • auto
  • break
  • case
  • char
  • const
  • continue
  • default
  • do
  • double
  • else
  • enum
  • extern
  • float
  • for
  • goto
  • if
  • inline1
  • int
  • long
  • register
  • restrict1
  • return
  • short
  • signed
  • sizeof
  • static
  • struct
  • switch
  • typedef
  • union
  • unsigned
  • void
  • volatile
  • while
  • _Alignas2
  • _Alignof2
  • _Atomic2
  • _Bool1
  • _Complex1

1 - Keywords added in C99.
2 - Keywords added in C11.

C99 changes from C89[edit]

C99 added the following keywords:

  • inline
  • restrict
  • _Bool
  • _Complex
  • _Imaginary

C11 changes from C99[edit]

C11 added the following keywords: