csharp convert long to int

Code Example - csharp convert long to int

                
                        // wraps around
int myIntValue = unchecked((int)myLongValue);

// throws OverflowException
Convert.ToInt32(myValue);
                    
                
 

csharp long to int

                        
                                int result =  Convert.ToInt32(long value);
                            
                        
 

Related code examples