Home » C# ProgrammingRSS

Reserved Keyword

Hello,

I am using a reserved keyword on my application: event. So I get the error:

Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in it. 

I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before the name?

Thanks,

Miguel

 

1 Answer Found

 

Answer 1

You *can*. But is may not be a good idea.

Check out this link:

http://dotnetdud.blogspot.com/2008/12/how-to-use-reserved-words-in-net-c.html

Hope this helps.

 
 
Search for  Reserved Keyword
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter