Possible Duplicates:
What does placing a @ in front of a C# variable name do?
What’s the use/meaning of the @ character in variable names in C#?
As you can imagine, Googling or Binging for any phrase containing an '@' is difficult.
In creating a new web service, one of the members of the imported C# proxy class is prefixed with the @. For example:
plan.@event = new Insurance.Event();
I assume that it is Visual Studio's way resolving potential conflicts with reserved words because 'event' is a reserved word. Changing the property in the web service interface to something other than 'event' (i.e. 'healthevent') removes the @ from the property. Is this a correct assumption?
Structures (also called structs) are a way to group several related variables into one place. Each variable in the structure is known as a member of the structure. Unlike an array, a structure can contain many different data types (int, float, char, etc.).
A "structure declaration" names a type and specifies a sequence of variable values (called "members" or "fields" of the structure) that can have different types. An optional identifier, called a "tag," gives the name of the structure type and can be used in subsequent references to the structure type.
Naming Conventions rules for Variables and Methods (Functions) are: It should begin with an alphabet. There may be more than one alphabet, but without any spaces between them. Digits may be used but only after alphabet.
We use the union keyword to define unions. Here's an example: union car { char name[50]; int price; }; The above code defines a derived type union car .
Yes, names that conflict with C# keywords may be escaped with the @ character.
Yes that is correct. You can use keywords as identifiers as long as you include @ as a prefix.
See http://msdn.microsoft.com/en-us/library/x53a06bb.aspx for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With