C language learning route under Linux

Source: Internet
Author: User
Tags time and date

Reprint: http://blog.csdn.net/xdw1985829/article/details/6817403

Unix/linux The Learning route of C language.
First, the tool article
"Public desire good things, its prerequisite." Programming is a very practical work, in your future study or work, you will often deal with the following tools, listed below to learn C language programming often used software and tools.

1. Operating system

It is easy to learn C on UNIX or Linux systems, so please select a UNIX or Linux operating system before starting your learning journey, and the UNIX or Linux system currently available for personal use has FreeBSD, RedHat Linux, SUSE Linux, etc., and in the installation package also provides a lot of useful tools, such as: GCC, make and so on.

If you have been using Windows and have no redundant machines to install UNIX on your side, you can use VMware to install virtual systems through VMware.

2. Compiling Tools

Currently, most UNIX or lnux systems offer CC or GCC compilers, and the simplest CC command format is as follows:

Cc-o Hello hello.c

Typing the above code in a UNIX shell environment compiles the HELLO.C program into an executable hello.

3. Make Tool

such as GNU make, System V make, and Berkeley make are the basic tools used to organize the application compilation process, but each make tool is different.

Most UNIX and Linux programs are compiled by running make.

The Make tool reads a file that contains instructions (the name of this file is usually makefile or makefile, but we call it "makefile" later in this article) and performs various operations to compile the program.

4. Debugging Tools

The simplest debugging tool: Add a print statement to your program, after you have some idea of how the program works, you can use some tools to help you debug, of course, you have to learn the tools to be used, such as: Dbx,gdb.

There are also some memory tools that can help you find memory leaks or buffer overflows, such as MEMWATCH,YAMD, and so on.

5. Other tools

1) VI or VIM

Unix below this editor. Mainly by a bunch of commands to edit text files, UNIX programming is best familiar with and proficient in using the VI editor.

Of course, you may need an integrated coding environment or a powerful graphical editing tool in your actual work.

Provides a Chinese-language vim online brochure: http://vcd.gro.clinux.org/

     2) Secure shell/putty
    

second, book article

"The book is the ladder of human progress." Learn a new knowledge, of course, to choose a few books suitable for their own, here are some of my own study of C language used books:

1. "C Primer Plus"
Recommended reasons: Suitable as an introductory book and basic functions of reference. The latest version of this book is the fifth edition, which introduces the C language in detail in the ANSI C99 standard.


2. "The C programming_language"
Reason for recommendation: the father of C language works authoritative and unquestionable. Although the book publishing time is older, it seems that there is no update, but still a classic book, the online version of the book is available in English electronic download.

3. "C Expert Programming"
Recommended reasons: This book can help some experienced C programmer to become a C programming experts, the most important thing is the book fun, let you fully enjoy the joy of programming.

< Span style= "FONT-SIZE:16PX;" >4. "C Defects and pitfalls"
> Recommendation: The knowledge revealed in the book can help you bypass the C language's own pitfalls and flaws, and reduce many of the common bugs in your code.

< Span style= "FONT-SIZE:16PX;" >5. Advanced programming for the UNIX environment

> reason: Since it's C programming in a UNIX environment, you have to talk about Unix programming books.

stevens's "UNIX Environment Advanced Programming" is my best recommendation, but also my desk must (if you are interested in network programming, you can learn about Mr. Stevens's "UNIX Network Programming" two volumes, if it is not fun, you can look at the "TCP/IP detailed" three volumes).

< Span style= "FONT-SIZE:16PX;" >6. The art of computer programming
> The reason: The Master of algorithms had to make a painstaking work. The plan is to publish a five-volume book, which appears to have been published in 3 volumes. Have an interest in the algorithm can be studied.

< Span style= "FONT-SIZE:18PX; Color: #ff0000; " > three, process

1. Learn C Grammar

Grammar learning is easy for a programming base, and even if you have not studied other programming languages before, I believe you can do it easily for 2 weeks.

It is important to note that you should not dwell too much on the details of the language, such as the problem of operator precedence and binding.

2. Learn C standard library

The ANSI C library divides functions into different groups, each with a header file associated with it. The C language standard library is very short and concise relative to other languages, such as C++,java, but first of all focus on the following libraries:

Ctype.h: Character processing

MATH.H: Math Library

Stdio.h: Standard I/O Library

Stdlib.h: Common Tool Library

String.h: String Handling

Time.h: Time and date

If you want to know the finished ANSI C library, you can purchase related books, these books will generally detail the user of each function and some points of attention, of course, you can also login http://www.dinkumware.com/manual ... amp;page= Index.html gets the ANSI C library details.

3. Difficulty in overcoming C

< Span style= "FONT-SIZE:16PX;" > 1) C language declaration:
    char * const * (*next) ();
  so there's a good memory method or rule to figure out, like no, If there is, it is not so torture. But take a look at the third chapter of C expert programming, and maybe you'll get something.
  also can only learn more practice, the so-called makes perfect, Hope this question doesn't leave a shadow on your mind. &NBSP;&NBSP;

2) Arrays and pointers:

The relationship between the array and the pointer, in the standard does not make very detailed provisions, and a lot of C introductory books on this issue does not give a very detailed explanation, so it will cause a lot of misunderstanding.

For this question, you can refer to the "C Defects and Traps" section 4.5 and "C Expert programming" chapter 4,9,10, I believe you have a thorough understanding of the content, will not be confused by this problem.

3) pointer and memory:

If you later write a larger program, you may find that the problem may be your biggest annoyance, and it may be a matter of your most time consuming debugging.

4) C version of the problem:

you have to be very careful with this problem, it is best not to mix the different version C features in your program, otherwise you will be confusing problems. If you must use it, you'd better know what you're doing.

There are some other difficulties in C and error prone areas, you can learn some of the previous experience. Here is a C FAQ link address, I believe in this document you need to solve most of the problems.

http://c-faq-chn.sourceforge.net/

4. UNIX Environment Programming

After studying the above, I believe that you will be able to program the UNIX environment. But you may need to know a little bit about operating system theory, so it will be easier to learn.

UNIX environment programming, you should focus on IO and process two chunks of content.

UNIX environment Programming has a very detailed and in-depth description of the UNIX environment, and there are a number of practical examples in the book, but it may take months to chew.
In a solid grasp of the above content, does not mean that you have to C language Learning branch has been completed, on the contrary, has just begun. Later you need to use the knowledge to solve a large number of different practical problems, in the process of continuous practice, you will deepen the understanding of C. With these basics in hand, you'll find that the other knowledge you need in the practice process will be very quickly mastered.

C language learning route under Linux

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.