Where can I get a list of reserved keywords in C#?
4 secs faster, but that's the VS7.1 version :p
dtb
2009-08-23 21:03:07
I bet its compiler specific.
Havenard
2009-08-23 21:08:00
@Havenard: There aren't a whole lot of C# compilers out there to begin with…
htw
2009-08-23 22:38:00
+9
A:
From Microsoft's website:
Microsoft Visual Studio 2008/.NET Framework 3.5
- abstract
- as
- base
- bool
- break
- byte
- case
- catch
- char
- checked
- class
- const
- continue
- decimal
- default
- delegate
- do
- double
- event
- explicit
- extern
- false
- finally
- fixed
- float
- for
- foreach
- goto
- if
- implicit
- in
- int
- interface
- internal
- is
- lock
- new
- null
- object
- operator
- out
- override
- params
- private
- protected
- public
- readonly
- ref
- return
- sbyte
- sealed
- short
- sizeof
- stackalloc
- struct
- switch
- this
- throw
- true
- try
- typeof
- uint
- ulong
- unchecked
- unsafe
- ushort
- using
- virtual
- void
- volatile
- while
kolistivra
2009-08-23 21:02:52
+2
A:
Note that if you need the keywords because you are automatically generating C# code to be compiled, you can use, for example, @new
as a variable identifier even though new
is a reserved word.
I'm having trouble finding the specific MSDN link explaining that, but csharp-online has this page on it.
Mark Rushakoff
2009-08-23 21:34:11