Both of them are integer data.
But long is short for long int, and int is an integer. The latter includes the former, which is a type of the latter. So there is no difference between the two, just a little difference. When writing code, use the default int and use long for special emphasis. In addition, the dragon is also unsigned. It's like going to breakfast. If you don't emphasize not eating coriander, the store may give it to you by default.
Second, storage space.
Long and int need different storage sizes under compilers in different environments.
As shown in the figure.
In the early 16 bit system environment, int used 2 bytes and long used 4 bytes.
In the later 32-bit system environment, int, like long, uses 4 bytes.
In the current general 64-bit system environment, int and long use different storage according to different compiler versions. A 32-bit compiler, like long, uses 4 bytes. 64-bit compiler, 4 bytes for int and 8 bytes for long.