Reading crazy C (1) Understanding Programming

Source: Internet
Author: User

Brother kbtiller wrote a correction on the textbook page and did not dare to correct it and discuss it together. In fact, the first article was read a year ago and failed to summarize the record due to the impetuous mentality of the holiday. Think about it as a drag-and-drop task. I'm sorry for the enthusiasm of Brother kbtiller. Most of the content in this article is a different description from the author's point of view. I am not a beginner, so it is better to pick a thorn than reading notes. Despite this, there are still many places in the book that benefit me a lot. For ease of sorting, the subject content is divided into four different parts. Some problems have vague boundaries and a large proportion of subjective factors. As for why it is so long, it is because I am nitpicking :).

I. Amazing: what I think is amazing

1. The most amazing thing is the author's exploration of the technical nature of the details, which makes me awe-inspiring. This is the highest quality that an engineer should possess.
2. P22: This neo painting is really amazing. (brother kbtiler, do you want to be exhausted? ^ ).
3. In section 3rd of P2, row 1st "only positive decimal Integer constants can be written in the code from these two rules", which has never been found before. Reading this is really like filling the top! P39 exercises are also true.
4. Emphasizing that data types are basically the highlights of the book in terms of technology. data types are indeed complex in C language and are also the most difficult to correctly understand and use, I have not systematically mentioned this in any of the C language books I have read. I have made in-depth analysis on almost every type of books. I like it!
5. P71-P73 specially explained the relationship between priority combination and operation order, which is also a very confusing place in C language, a lot of skilled people who learned year 35 often make mistakes, in the final analysis, the foundation is not well established. Here we analyze the relationship between them very professionally and help beginners avoid many problems. This is the most lacking of many C language books, especially Chinese textbooks.
6. Reading = as a value assignment is indeed a great idea.
7. p111 uses the question of determining the triangle type to train the reader's logical judgment ability. Beginners are not proficient in understanding and control the code, and may encounter logic disorder. At this time, they need to strengthen their exercises.
8. p142 explained the plus (+) operator on a 4-page basis and helped the students of "Professors" and "experts" eliminate the virus. The author worked hard!

2. Knowledge error: Where knowledge points are wrong or missing

1. the ansi c committee was established in 4th according to my documents in Wikipedia and C reference manual, it was formally established in 1983, and the ansi c standard, commonly known as c89, was launched in 1989. This should be wrong.
2. Lines 8th in section 8th of P13 text "all the characters in the text are output as they are, unless the "/" Bootstrap Character Sequence or the "%" Bootstrap Character Sequence "appears except for the/and % Bootstrap character sequences ,?? The triplicate sequence is also converted, although this guy is almost forgotten.
3. The first line of P13 code 3rd is "/",/N,/a,/B,/t ,//,/",/'", here, why is one more/"and/V/F/R/missing /? This is a character escape character, and there are other escape characters. The description is not accurate enough. P49 also has this problem.
4. p14 footer 1 "it seems that Chinese characters can be used in C Language compiler. The Chinese version of vs2008 supports Chinese characters as identifiers. At that time, I found that I define a set of Chinese characters. If you see this, will you consider using VC ++ express as your preferred ide when you reversion the books.
5. p24 text section 4th, line 2nd "there are many terminologies for calling this number, some of which are ASCII codes and some are internal codes, some are called unicode encoding. Both the ASCII code and the Unicode code are internal code (if there is also an internal code), it is not suitable to describe them in parallel here, you should delete the internal code and change it to another one, such as GBK/gb2312.
6. Line 4th in section 3rd of the p48 text "so signed can save writing. If it is incorrect, it is at least not rigorous ." It is actually wrong and cannot be omitted. In the Declaration and definition of a function, if one uses signed Char and the other uses char, compilation errors will occur under GCC. This has also been discussed in the Cu forum, not much to explain, see the link for details: http://bbs.chinaunix.net/thread-1834841-2-11.html from the 17 th Floor, there are low quality please automatically ignore.
7. p82 text section 10th, line 1st "within {}, the previous c99 rule is to finish the compiler and let the CPU do it. That is to say, you must first write the Declaration and then write the statement ". C89 does not have this rule either. It is probably because C of K & R has this requirement (I am not sure if K & R does not require it, But turboc will require it ).

3. Improper expression: Incorrect location in the book or location that may easily lead to ambiguity or omission

1. Section 3, section 3, line 2, "generally, the computer we see usually has the keyboard, mouse, display, and chassis ". The chassis is not suitable here. After all, the chassis is just an empty shell, and the content in it is the most important. Therefore, it is more suitable to change the "chassis" to "host.
2. In section 21st of P6, the second line is "add, move in assembly language". The preceding example uses mov, but it is better to write it here as move or unified.
3. "This standard was issued by the International Standardization Organization (ISO) in 4th )", although the ISO standard English name is International Organization for Standardization, it looks odd (it seems IOS is more appropriate --!) In addition, p47 also uses International Organization for Standardization.
4. Lines 3rd in section 1st of P9 body "because of the use of a pre-written program section (this is provided by the compiler )". This is the printf library function. The library function is not part of the compiler, but the beginner does not know what it is called a function library. Therefore, we recommend that you change it to "This is provided along with the compiler ".
5. "Table 1-1" is the new keyword of c99 ." However, table 1-1 shows all the keywords of c99. Only the marked keywords are added, and the syntax is also a bit problematic. Therefore, we recommend that you change table 1-1 to all the keywords of c99 ."
6. P20 exercise 2.6 "using the printf () function should be compiled at the beginning of the Code. It is the compiler processing command to explain the name of the function". "Compilation is" should be a mistake.
7. Lines 3rd in section 2nd of P25 text "written after section 123; because section 123 cannot be written separately in code ." This sentence is hard to understand. It is better to change it to "cannot be a single code.
8. p32 text section 2nd-line 1st "memory (memery unit)" is the meaning of memory devices ." Memery unit is better to be translated into memory units. After all, it is followed by a unit.
9. In line 1st of section 15 of the p36 text, "calculate a negative complement code. You can also use the total number of digits of the 2 ^ number of machines to subtract this number ." The subtraction is equal to the addition of positive, so it should be "directly obtained by adding this number ".
10. the P49 Code contains 5th "/octal number/X hexadecimal number". The C language still requires the length of escape characters, and the octal number cannot exceed 3, there are no more than two hexadecimal values, which should be written later.
11. Lines 6th in section 2nd of P60 text "However, 12/10 outputs 1 in % 2D, that is, 0 in front of 1 is not output. If you want to output 02, then, a value of 0 -- % 02d should be written between % and 2D. Here, 01 should be output and 02 should be written by mistake.
12. Exercise 12. "enter an ID card number and output the person's birthday ." I didn't talk about any input functions before, so this question is not suitable here.
13. p67 introduction to operators in section 3rd of the body, with suffix operators, but not prefix operators.
14. In section 3rd of the p69 body, "in this expression, in the expression on the right... "I have always called = A value assignment operator. Here, a value assignment number is generated, which is not harmonious.
15. Note 2 of p73: "In a sense, the monotonicity can also be separated by the symbols of continued rows." Words "are mistakenly written as" monotonous ", here I instantly think of a rigorous and kind high-end instructor.
16. In section 11 of p75, "Do not think more about cast operations than cast operations." A non-score may seem too embarrassing, you can remove your preference.
17. The p84 Code uses the scanf statement. This is the first time this book mentioned this statement, but it does not have any explanation. It is recommended to explain the basic usage of scanf, simply to explain the usage in the code.
18. p128 Figure 4-6 "program development process" this figure looks similar to the program flowchart except for the elliptic used for annotation. There is an end frame, but where is the start frame? To ensure integrity and consistency, we recommend that you add the start box.
19. Row 7th in section 1st of p131 body "if the expression value is not 0, execute the statement and go to (0) to evaluate the expression value again" without (0, it should be (1 ). P138 also has this error.
20. p136 text section 3rd, row 3rd "test results show that the program runs properly when the input is an integer of 0 ." A word is missing here, which should be "input 0 integers".
21. psung code 2nd block 1st "while (printf (".... ")/" this code is followed by a "/", but the escape character code is not used here and will not cause errors. It seems redundant./is generally used on macros.
22. p146 text section 5th-line 3rd-"painting tigers is not a reverse dog"-it is more suitable for "painting tigers is not a reverse dog", no matter from the words or the results obtained by Google ^
23. For lines 14 and 15 of the p149 code, see above.
24. "In addition, expression 2 in the for statement () is more concise ." This is not only concise, but also reduces the number of judgments and increases the running efficiency. I think you can also mention this.
25. p158 text 10 section 1st "before the ordering point, the computation and sub-effects required by the computer must be completed at the ordering point." It sounds strange. How can this be done: "the computation and sub-effects executed by the computer must be completed before the ordering".

Iv. Opinion difference: not a mistake, but subjective differences are large.

1. P9 footer 3 "using IDE requires the risk of being accused of being a cainiao. Some experts prefer to show that they do not use ide But use more primitive development environments. But in general, it is more convenient to use ide to develop software ." I agree with this sentence. For Beginners, IDE can hide a lot of complicated details, but some details will be very important for future development, such as compilation and linking. Only when the command line is used can we really understand the compilation parameters and the link process. This is not taught in most C language introductory books, or even mentioned (probably because the platform is too different ). However, I think it is necessary to put forward it at an appropriate time (for example, when talking about the standard library later, or compile and link as a special chapter for advanced topics ), otherwise, the beginner simply forgets this.
2. Row 1st of section 13 of p32 body "variables are sequential, named, used to store data, and buckets with type meanings can be obtained ." A special variable is the register variable, the register variable cannot take the address because it may exist in registers rather than memory. Knowing that it has a register (but does not know which number register) does not know the location? This is a matter of opinion and wisdom.
3. From p71 to p84, the pure theoretical points of operator priority, associativity, type conversion, and statements are described. I personally think these knowledge points are too intensive, in addition, there are few actual examples in the middle (examples of the complete code), which puts a lot of pressure on beginners. It is recommended to insert examples in the middle to ease the progress, or spread the knowledge points to other chapters.
4. In section 4/5 of the p96 text, the sentence "because 3 is indeed less than 4, the calculation result of 3 <4 is 1" does not exist because 4 <3, therefore, the value obtained by the 4 <3 operation is 0. "Here is the first time we have come into contact with relational operations. Readers have no concepts or knowledge about relational operations before, and do not know whether there is any causal relationship, so here, "because... so... "This is not a proper word, and the narrative tone is more in line, but the reasoning taught by the author can also pass through.
5. P97 4.22 p139 5.22 titles are all "Examples". This seems informal, especially the large titles that appear in the directory. We recommend that you add a qualifier.
6. P110 p111 code block "If (pfh_d = 1)" If (pfh_d = true) "is an example of _ bool usage. However, when we regard a volume as a boolean type, we often do not use the criterion operator, because the true and false Meanings of the variable do not need to judge whether it is equal to the true or false. Therefore, it is generally written in this way, which is more concise and easier to understand "If (pfh_d )".
7. In p118, "The Master said goto" is a little too hasty. At least I will use goto in two places. 1. Different return values will be produced in different places, however, to ensure the code structure is clear or there is a uniform thing to do before the return, only one return is used. 2. Loop/switch nesting jumps out directly. We have also discussed this in Cu.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.