The value range of int is a specific value, not the number of bytes it occupies. In the code int a=x, as long as the value of x is within the range of int, it is correct.
Extended data
Int is a function that rounds numbers down to the nearest integer. Int is an integer function among the common functions in the database, which is often used to judge whether one number can be divisible by another.
In C# language, an array of any data type needs 20 bytes of memory space, plus the dimension of each array accounts for 4 bytes, plus the space occupied by the data itself. The memory space occupied by data can be calculated by multiplying the number of data elements by the size of each element.
Like four twos? Data in a one-dimensional array consisting of integer data elements of bytes, accounting for 8 bytes. These 8 bytes plus another 24 bytes make the total memory space required for the array 32 bytes. Variables containing arrays need 12 bytes more than a single array.
References:
Baidu Encyclopedia-Data Type