c# - Is there a performance difference between int i =0 and int i = default(int)? -



c# - Is there a performance difference between int i =0 and int i = default(int)? -

i creating integer , wanted instantiate 0 before working with.

i wrote firstly

int = default(int);

then removed replace other 1 is

int = 0;

i know if selection best in mini mini performance. default() function increment instructions @ compile time?

no, resolved @ compile time , produce same il. value types 0 (or false if have bool, that's still 0) , reference types null.

c# .net c#-4.0

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -