In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail "C language input Chinese string example analysis", the content is detailed, the steps are clear, the details are handled properly, I hope this "C language input Chinese string example analysis" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.
Strings in C language are stored in the form of ASCII code table, and input English characters are entered into the register in the form of ASCII codes corresponding to English characters, such as outputting hello worldcodes:
Disassemble c to get
You can see that the ASCII code of h is 68 and the ASCII code of e is 65 and so on. What about the Chinese characters? There is no corresponding ASCII code for Chinese characters, can it still be displayed?
The answer is yes, of course, the coding rule used to store Chinese in the computer is GB2312 or GB2312-80, which stipulates that a character less than 127has the same meaning as the original, but when two characters greater than 127are linked together, it represents a Chinese character, so that we can combine about 7000 simplified Chinese characters. In these codes, even the numbers, punctuation and letters that already exist in ASCII are re-coded with two bytes long, which is often called "full-width" characters, while those under 127th are called "half-width" characters.
Disassemble the code
This is the storage method in Chinese.
But in this way, there are drawbacks. The meaning of the symbols in our country's GB2312 may be different from those in other countries, that is, the two countries use the same number to represent different symbols, so Unicode appears, and I will not explain the coding method of Unicode.
After reading this, the article "case Analysis of input Chinese string in C language" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.