Grammar and Function library

Source: Internet
Author: User

the key to C language learning is to first understand what is learning C language in the end ?

I asked, some students will open the textbook, pointing to the directory said, I know I know, there are variables, data types, looping statements, functions, pointers and so on!

Unfortunately, if you think learning C is to learn these things, you have to quickly correct the view, otherwise the next study will be difficult. Because I used to fall into the pit, this narrow point of view let me waste a lot of time to learn trivial details, and let me slow to contact with more important knowledge, the result is above his business-know many people do not know the useless knowledge, but can not write anything really decent program.

The so-called "grammar" is the most focused content in the introductory textbook. These are the so-called variables, data types, branch judgments, loops, functions, pointers, and so on.

The content is boring, but the good news is that it's not difficult, it's something formatted. As long as you practice more, it will automatically engraved in your mind, become a subconscious habit.

But "grammar" itself is useless. Because it's just a format specification, you learn better and can't lead you to write bad programs. Because in the software design, in fact the core part is still in its "function library" part.

What is a "library of functions"?

Simply put, the function library is someone else's written C function, directly provided to you, you just call inside the function, you can achieve a certain function. For example, the printf () function, you must know that you can just call this function and you will be able to display a piece of text in that Dusky window. You don't understand the inner workings of printf (), but you know that you just have to follow the instructions to invoke them and you can implement the corresponding functions.

This is the library of functions--written by others, packaged in front of you, and you can freely tune the set of functions used to do all kinds of things.

It is extremely important to learn to call the library functions of others and even write your own library functions. Because a function is essentially a functional unit. The more infrastructure you have, the greater your playing space. The truth is so simple. This is the second point I need to emphasize, and the key to writing a practical C program is to study and learn to use various library functions.

You see the next-door Wang Er wrote a three-dimensional program that allows a colored cube to spin in the air? Find the OpenGL library function to use. What, what? Liu Dabao wrote a network software that can chat on a LAN? Get the Socket library.

You see? How important is the library function?

However, the learning of library is not isolated. Many library functions need some domain knowledge support behind them. As I said in my first point of view, there is a need to prepare knowledge. Learning to understand a library is not just about knowing how to call it, but more about what we know about a particular area--the network, the digital image, the cryptography, the operating system, and so on.

Basic learning process and general law

As I mentioned earlier, C language learning is mainly about getting started with grammar and then to the library of functions. More specifically, the following phases are included:

1. Learn Basic grammar

2. Learn a few simple C-language self-bringing functions

3. Learn the basics of programming (data structure, algorithms)

4. Learn more about the more powerful C-language functions

5. Learn some basic theoretical knowledge (operating system, database, network, image ...) for a specific application area.

6. Apply previous stage learning to knowledge further learning library of functions provided by other people (network processing, operating system management, image, cryptography, etc.)

Grammar and Function library

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.