Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What does s= 1L mean in C language?
What does s= 1L mean in C language?
S= 1L in C means to force 1 to be long, and assign it to the long variable S. Obviously, S is defined as long. Because c indicates that the integer is of the int type by default, when assigning the int type of 1 to the long variable S, it is necessary to force 1 to be long, so that the data types around the = sign can match. But there is no need to write L here, because the int type is "shorter" than the long type, and the compiler will automatically align the short type with the long type-this is called implicit type conversion. But writing L is a good habit, which is helpful for code reading.