Possible Duplicate:
C#, int or Int32? Should I care?
I’m using GetPosition(this) when MouseMoved event gets triggered so having:
Point pt = e.GetPosition(this);
As far as I see both following type casts work but which one is recommended and why?
int x = (int)pt.X;
int x = (Int32)pt.X;
They do exactly the same thing – they’ll even compile to the same IL. (Assuming you haven’t got some crazy other
Int32type somewhere…)intis just an alias forglobal::System.Int32.(This doesn’t just apply to casting – it’s almost anywhere that a type name is used.)