The same is not true of assigning a ''long'' to an ''int'' since a long is capable of storing significantly larger numbers than an ''int'' (an ''int'' is 4 bytes long versus 8 bytes for a ''long''). Attempting to squeeze a ''long'' into an ''int'' value would inevitably result in lost data. For this reason the C# compiler will flag such an attempt as an error and stubbornly refuse to compile the code.
The same is not true of assigning a ''long'' to an ''int'' since a long is capable of storing significantly larger numbers than an ''int'' (an ''int'' is 4 bytes long versus 8 bytes for a ''long''). Attempting to squeeze a ''long'' into an ''int'' value would inevitably result in lost data. For this reason the C# compiler will flag such an attempt as an error and stubbornly refuse to compile the code.