Click here to Skip to main content
15,888,279 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the difference between
C#
decimal _decim;

and
C#
Decimal _decim; (Decimal in Green colour)

thankyou
Posted
Comments
Sadique KT 20-Jul-13 1:35am    
http://www.codeproject.com/Questions/260343/Decimal-vs-decimal-csharp

decimal is a c# keyword, Decimal is a Type for the CLR (language runtime), decimal is compiled to Decimal.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Jul-13 1:36am    
Correct, but requires just a bit more accuracy. Please see my answer, for comparison.
—SA
To make solutions 1 and 2 more accurate:

Keyword "decimal" is the alias of the type System.Decimal in C#. In other words, "decimal" is specific to C# and is compiled as System.Decimal. As this is not a type but a keyword, it does not require namespace prefix, and it is not a subject of name conflict (in other words, you cannot use "decimal" as user identifier but can use "@decimal").

—SA
 
Share this answer
 
Comments
Mehdi Gholam 20-Jul-13 1:39am    
You complete me :) 5'ed
Sergey Alexandrovich Kryukov 20-Jul-13 2:26am    
Thank you, Mehdi.
—SA
decimal is specific to c# language and Decimal is .NET compliant data type that all .NET compliant languages can use.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Jul-13 1:35am    
Not 100% complete and accurate. Almost. Please see my answer...
—SA

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