General information
Category:
Coding, syntax and commands
That's too funny that they specifically write "does not mean variant"..
So I guess if it was a variant, the compiler wouldn't assign it the most appropriate type then. :-)
But, I think I see the difference.. if we have a variant (which I have not used in forever) we can say
variant varTest = "Hey";
varTest = 9;
That would work, correct?
But in the case of c#,
var varTest = "Hey"; // varTest would by type string
varTest = 9; // compiler error.
>"It is important to understand that the var keyword does not mean “variant” and does not indicate that the variable is loosely typed, or late-bound. It just means that the compiler determines and assigns the most appropriate type"
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only