Overview of C-C language, c-c Overview

Source: Internet
Author: User

Overview of C-C language, c-c Overview

1. Data + algorithm = program.

2. a c language program is composed of one or more functions. A function is composed of statements. A statement consists of keywords, identifiers, operators, and data. statements can be divided into declaration statements, value assignment statement, control statement, function statement, and empty statement.

3. # The include statement is a C pre-processor command. The pre-processor pre-processes the source code before the C compiler works. That is, the complete content of the contained file is entered in the row.

4. The int main () function is the starting point for program execution and the entry point of the program.

5. Two Annotations :/*Note */(Comment multiple rows), // comment (comment a single row ).

6. curly braces {}, program body, function body, and code block.

7. the declaration statement declares the names (identifiers) of variables, functions, or other entities and data types. The Compiler allocates suitable storage space in the memory based on the data types, and associate the identifier with a specific location in the memory.

8. In C language, all variables must be defined (declared) before use.

9. The data type of the variable is the basic prerequisite for the computer to properly store, obtain, and explain the data.

10. The identifier is a string of letters and numbers starting with a letter. The underscore (_) is a letter and is case sensitive. The operating system and library C usually start with one or two underscores (_), which are reserved words and cannot be used as identifiers. Keywords in C language cannot be used as identifiers.

11. assignment operator =, printf () function, return statement. Escape Character/n, format specifier % d.

12. Simple C program structure

# Include <stdio. h>

Int main (void)

{

Statements;

  return 0;

}

13. The function must be declared (function prototype) before calling. The order of function calls depends on the position of the function call statement, not the position defined by the function.

14. skills to make the program readable: Use meaningful names (identifiers), annotations, empty lines to separate different concepts, and a statement to use a line.

15. Modify the debugging error for the program error bugs. Misspelling (incorrect symbol), syntax error (correct symbol is placed in the wrong position), Semantic Error (logical error, Wrong expression meaning ).

16. The program status refers to the set of all variable values given to the specified point during the program running.

17. debugging method: browse the code to eliminate simple spelling and syntax errors. Think of yourself as a computer and execute the code step by step. Insert the printf () statement to output the variable values of interest. Use the debugger. Debugging is to monitor the tracing program status.

18. The program is your description of the idea of the computer's behavior within the framework that the compiler can successfully process.

 

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.