Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why can the character types of C language be used for numerical operations?
Why can the character types of C language be used for numerical operations?
This will be explained from the storage mode of character data in memory. In C language, character data is actually stored in memory in binary form, and it is not really a character stored in memory. When adding and subtracting character data, the system will convert char data into int data in an invisible way before adding and subtracting. Therefore, from the storage mode of character data in memory, character data can be numerically operated, and the numerical operation of character data is actually the corresponding numerical operation of the ASSIC code corresponding to the character itself.

C language is a general computer programming language, which is widely used. The design goal of C language is to provide a programming language that can compile and process low-level memory in a simple way, generate a small amount of machine code and run without any support of running environment.

Although C language provides many low-level processing functions, it still maintains good cross-platform characteristics. C language programs written in standard specifications can be compiled on many computer platforms, even including some embedded processors (single chip microcomputer or MCU) and supercomputers.

In 1980s, in order to avoid differences in the grammar of C language used by different developers, the American National Bureau of Standards formulated a complete set of American national standard grammar of C language, called ANSIC, as the original standard of C language. At present, the standard C 1 1 released by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) on February 8, 2000 is the third official standard of C language, and it is also the latest standard of C language, which better supports Chinese character function names and.