Results 1 to 4 of 4

Thread: What does at @ identifier means in C#

  1. #1
    Join Date
    Aug 2009
    Posts
    155

    What does at @ identifier means in C#

    I am learning C sharp. I have to connfess that Csharp has introduced many concepts for programming an application on a .NET platform that makes it so easy to code and use it. But still I have confusion on the use of @ symbol in Csharp. What is the @ symbol actually used for. I guess it is for a String Literal only. Am I correct ?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: What does at @ identifier means in C#

    The @ symbol does not always conveys that the following is a Verbatim String Literal. If a string is enclosed in quotation marks and is precided by the @ sign only the it is considered as Verbatim string literal. But we can make use of @ symbol to make use of keywords of Csharp as general variables.

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: What does at @ identifier means in C#

    Csharp is the best to code various progams that are for Microsofts .Net platform. It helped me alot to understand and make applications for .Net. To solve your confusion the answer that it is not that @ symbol signifies everything as a string literal always. It can be useful for including Csharp keyword as a variable in your programming code.
    Last edited by Zecho; 17-11-2009 at 01:20 AM.

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: What does at @ identifier means in C#

    Let us consider that for instance the programmer need to make use of a keyword as a variable since it is very easy to indentify the value contained in that variable from its name, in this case the programmer wants a variable with name class.
    For example,
    Code:
     int class = 22;
    But as we know that class is a keyword for C# and thus it cannot be used as variable name. But C# allows this by prefixing the at sign- @ before the keyword.
    Code:
    int @class = 22;
    Although this is not considered as a good practise.

Similar Threads

  1. <identifier> expected error
    By mbueling in forum Software Development
    Replies: 2
    Last Post: 18-10-2011, 06:04 AM
  2. Multi-part Identifier could not be found
    By Ananias in forum Software Development
    Replies: 3
    Last Post: 19-05-2009, 01:03 PM
  3. TrIDNET - File Identifier
    By Spykar in forum Reviews
    Replies: 2
    Last Post: 02-12-2008, 07:07 PM
  4. Identifier Expected Error in JAVA
    By Brake Fail in forum Software Development
    Replies: 7
    Last Post: 25-10-2008, 02:35 PM
  5. Replies: 3
    Last Post: 15-09-2008, 02:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,191,936.39873 seconds with 17 queries