Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What are the transformation rules of four types of data in C language: int long unsigned and char?
What are the transformation rules of four types of data in C language: int long unsigned and char?
First of all, in C, operations between data must be of the same type in order to perform operations. If the types are inconsistent, you must first convert to the same type-from low to high.

In this problem, the data type level from low to high is: char→int→unsigned→long. Switch from low level to high level when switching.

For example, there are two numbers whose data types are char and long. ? Char must be converted to long before the operation (because long has a higher level than char). ?

But it can't be understood as: first convert char into int, then into unsigned, and then into long.

C language is a computer programming language, which has the characteristics of both high-level language and assembly language. Introduced by D.M.Ritchie of Bell Institute in America on 1972. After 1978, C language was transplanted to large, medium, small and microcomputer. It can be used as a working system design language to write system applications, and it can also be used as an application programming language to write applications independent of computer hardware. It has a wide range of applications and powerful data processing capabilities, not only in software development, but also in various scientific research. It is suitable for compiling system software, three-dimensional and two-dimensional graphics and animation, as well as specific applications such as single chip microcomputer and embedded system development.

In the development, they also consider porting UNIX to other types of computers. The strong portability of C language is vividly demonstrated here. Neither machine language nor assembly language is portable, so programs developed for x86 cannot run on machines such as Alpha, SPARC and ARM. C language programs can be used on any architecture processor, as long as the processor of that architecture has the corresponding C language compiler and library, and then the C source code can be compiled and connected to the target binary file to run.