|
-
April 16th, 2009, 06:52 AM
#1
Variable Suffixes
Hey,
Ive noticed on my travels that there seem to be alot of variable suffixes that ive never seen before...
an example would be:
Im not sure if Object is of type nullable... but it means that the var could be nullable i think... could be wrong though, ive never had need to use it.
Anyway i was wondering:
1) Is there a list of these suffixes somewhere online and what they do?
2) Specifically what does Object^ var; do?
Any advice would be great!
-
April 16th, 2009, 06:58 AM
#2
Re: Variable Suffixes
1) Is there a list of these suffixes somewhere online and what they do?
2) Specifically what does Object^ var; do?
1) - Just lookup (MSDN, google, etc) the specifications for C#2 (which introduced nullable types amongst other things) and C#3 (which introduced implicit local variables declarations amongst many other things)
2) - That looks like C++/CLI syntax. Did you see that in C# code?
-
April 16th, 2009, 07:10 AM
#3
Re: Variable Suffixes
 Originally Posted by nelo
1) - Just lookup (MSDN, google, etc) the specifications for C#2 (which introduced nullable types amongst other things) and C#3 (which introduced implicit local variables declarations amongst many other things)
2) - That looks like C++/CLI syntax. Did you see that in C# code?
Im pretty sure it was in source code, ive not seen once single isntance of it, ive just seen these suffixes dotted around but have never been able to track down a single article about them...
-
April 16th, 2009, 07:21 AM
#4
Re: Variable Suffixes
the ? after a variable type declares it nullable (for value types, but object is already nullable).
the ^ suffix is a reference type and is used in C++ to differentiate between a managed pointer and a native pointer. http://www.codeproject.com/KB/books/...ionCh1Ex1.aspx
Last edited by MadHatter; April 16th, 2009 at 07:24 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|