C-Language Primer Guide (for reference only)

Source: Internet
Author: User

C Language Books recommended

In Zhejiang University Library, the computer books are concentrated in the TP area on the third floor.

"Head first C". The Book of Head first series is basically very high quality. The book has a lot of illustrations, and in general it is a relaxed and enjoyable way to explain the headache of C language to beginners. Although the book is a bit thick, but actually not many words, content is also quite rich, English original reading difficulty is probably also high school reading comprehension difficulty. The library has a translation of "Hi turn C language", but I strongly recommend to see its English photocopy version of "Easy C language", one of the English version of the book itself is not very difficult, Secondly, it is easy to set up information about reading English materials (especially when you see yourself reading such a thick English book).

Now many domestic publishing houses (such as Southeast University Press, Electronic Industry publishing house), have launched a lot of foreign well-known textbooks of the photocopy, content, typesetting are the same as the original import, the price is greatly reduced. The translation quality of most of the foreign textbooks is pretty bad, and now the photocopy book is a good solution to the problem.

"C programming:a Modern Approach" (second edition). The library does not seem to have a photocopy of the book, but it has its Chinese version of the modern method of programming C language. If you like to read the English version, you can download the PDF yourself. This book is more serious than head first C, it looks more like a textbook, overall more systematic, comprehensive and rigorous, but also a good introduction to the book.

"C Traps and Pitfalls". Both English and Chinese libraries are available. The title of the Chinese translation is "C Traps and defects", the photocopy may also use the title. The book is so classic that it was published in 1989 and is still in the major C language must-read list. Because this book is very early, so there may be some places in the modern C language standard some differences, for example, at the time main () can not explicitly specify the return value type, the default is int, but now the C standard provisions must be explicitly declared return value type int, that is, int main () { ...}。 It is therefore advisable to read the book after reading the above two books. This book is very thin, also bedrooms page, but the content is very good, the pointer, the part of the array is particularly incisive, and some of the basic principles of C language is also very clear, so that you can avoid a lot of unnecessary rote learning. Will certainly be a big success.

Why not recommend Rectification's book? There are many reasons. One of the biggest reasons is that Tan Xu's mistakes are too many (it is said that there are hundreds of them, but I have not confirmed them). Mr. Tan does not seem to care that C language has the C language standard this matter, printing error What also forget, a lot of fundamental is the conceptual error, really fraught. Of course, we also have to look at the problem from the history, at the time of the Tan Shugang release, the computer has not been popularized, let alone the relevant information, rectification out such a simple and understandable C language book is very meaningful indeed. But now, since there are a lot of better textbooks to replace it, why not stick to the tan book? Tan Xu or leave it to non-professional students to go to the test, we are professional but really want to deal with the code every day.

Compiling the environment

Do not use Vc++6, 2018 years is coming, you still use 1998 years of things released, do not think that there is a problem? Even if you want to use a new point of visual Studio Community or Community, it is too big to use code::blocks.

Of course, I personally suggest that in the early days of learning, try to use the command line to compile the program in a Linux or Mac environment. This compiler generally uses more than GCC and clang. It's best to understand how makefile is written, so you know what happens when you click the Compile button in Visual Studio. This is also easy to understand the C language multi-file compilation principle. This is just a suggestion, and if it's too much of a hassle, it won't be a big problem to continue with integrated development environments like Visual Studio.

There is something that must be learned, and that is the debugger. The code was cool, commissioning the crematorium. There is someone, graduated from the undergraduate still do not know the world has a debugger this thing, also thought debugging code are open eyes blind touch, East change a little, recompile, oops did not succeed, and then west to change a little, oh did not succeed, but also mixed into a few new problems in, more and more wrong. How is that possible? With the debugger, you can save a lot of blind touch time, it can follow your instructions to set a breakpoint, let the program run to a point in time to stop, and then you can use it to observe the current values of all variables, you can even use it a single step to execute the code, step by step slowly, to see where the program will be falls. So don't waste your life on the blind touch, have that time than go to the playground to run a few laps.

You have to mention the code style. What does code style do? Used to enhance the readability of the program. You have to know, you write your own code is not just for the computer to read, you have to read it, others may want to read your code, if you write code legibility is poor, not indentation or even indentation, not only appear sloppy, but also not easy to find errors (I have seen some people, find a half-day error did not find out, the code indentation specification, Immediately found the reason, ah original is missing a parenthesis).

Code style Questions I would recommend to read the following two documents for the time being

High-quality C + + Programming Guide (Lin Rui)

This guide is part of the code-based style and can be downloaded by yourself PDF

"The C programming Language" second Edition

This is the C language of the father to write the C teaching material, although not suitable for 0 basic beginner, but the inside of the code style is quite clear (commonly known as k&r style). There is a book in this office which can be borrowed to see.

C-Language Primer Guide (for reference only)

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.