Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Why @ symbol is used in the following statement....
Where can we use this type of statements.....

C#
string[] @params = null;
Posted

1 solution

The @ symbol allows you to use reserved word. For example:
C#
int @class = 15;

The above works, when the below wouldn't:
C#
int class = 15;


The prefix "@" enables the use of keywords as identifiers[^], which is useful when interfacing with other programming languages. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An identifier with an @ prefix is called a verbatim identifier.
 
Share this answer
 
v2
Comments
Rahul Rajat Singh 26-Jun-12 5:50am    
good answer. +5.
Prasad_Kulkarni 26-Jun-12 6:18am    
Thank you Rahul!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900