reply with real life example appreciated.
Thanks.
When we use var keyword for variable declaration?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 30, 2013, 9:41 AM EDT
http://www.c-sharpcorner.com/UploadFile/b942f9/when-should-you-use-the-var-keyword-in-C-Sharp/
Jignesh TrivediRank #16 · 50.3K reputationPosted May 30, 2013, 10:52 PM EDT
hi,
Var is an implicit type.Implicit means indirect way of defining variable types.
note that var define data type statically (compile time) not run time.
So you can use it anywhere.
Please refer to know more about var.
http://msdn.microsoft.com/en-us/library/bb383973.aspx\
http://www.dotnetfunda.com/articles/article1567-what-is-the-use-of-var-keyword-in-csharp.aspx
hope this will help you.