Fundamentals of C language (i)

Source: Internet
Author: User

The operation of anything can not be separated from two parts, one part is "things", a part is "run", the former is state, in C language is represented as constants, variables, etc., The latter is the process, in C language expression as statements, functions and so On.

Language is the expression of the tool, C language is no exception, it is a person to tell the Compiler's "language", and then the compiler to convert it into Assembly language, assembly language is the compiler to tell the computer "language", we use C language written in the file is called code, the compiler after the translation of the file called the Program. The compiler translates code into programs into three processes: preprocessing, compiling, and Linking. With the program, people can interact with the computer, people say to the computer "words" is called input, the computer said to people "words" is called Output.

No rules inadequate surrounding area, then we'll talk about the C language "rules".

Any language is a linear structure, no matter how complex our brains think, what we say can only one word to spit out, the code written in C is also a one-dimensional, may be a lot of people disdain such a fact, in the compilation principle, all the analysis of grammar can not be separated from such a basic fact, We also unwittingly linearization when writing Code. Let's look at a simple example:

If the entire program is likened to a "line", then the "line" must first have an entry, which is the invocation of the main function ("main (agc, argv);"), until the return statement (or exit Function) is executed ("return 0;"), We left the program, this is the whole "line" of "thread" and "line end", accurately said the "bead" thread and the end of the "beads", the middle string up the "beads" is a statement, this is the basic framework of the program, as for the beginning of the # include directive, these are pre-processing instructions, preprocessing directives correspond to the "preprocessing" phase of translation, which corresponds to the "compilation" stage of translation, in other words, the preprocessing instructions are for the statement service, for example, "#include <stdio.h>", which introduces the definition of scanf function and printf Function. So that we can use the SCANF function call and the statement that the printf function calls.

Fundamentals of C language (i)

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.