My embedded journey day02

Source: Internet
Author: User

  1. Programming: find a solution in case of a problem

  2. The C language program can directly perform addition, subtraction, multiplication, division, and division of four arithmetic operations. The four arithmetic symbols are + -*/)

  3. A semicolon is used to end a complete task. We call it a statement.

  4. Each Complete operation step must end with a semicolon .;

  5. Each content ended with a semicolon is called a statement;

  6. Use {} to group statements;

  7. Multi-Level Grouping nested braces

  8. All top-level braces ({}) must have their own names. The names of the two top-level braces must be different.

  9. The name is written in front of the top-level braces. The name can start at will. Main rules: if there is only one top-level braces, its name must be main.

  10. You must have at least one top-level braces.

  11. The parentheses before the braces must be written. --- Used to pass Parameters

  12. Return Value of the ashes function of a person's life --- all top-level braces can be left with a number or left blank. Use

  13. Return value;

  14. The C language supports multiple keywords. return is a keyword that can be used to specify legacy numbers. Return has two functions: 1. It is used to specify the remaining number.

  15. In C language programs, numbers are grouped. Each group is called a data type. Numbers in different groups cannot be mixed.

  16. All numbers must be clearly specified. By default, they are considered to be all numbers without decimal places in int type programs. By default, they belong to the integer type.

  17. The data to be used in the braces must be declared outside the braces intmain () {1000-400; return0 ;}

  18. Each data type is named in C language, and int is the name of the integer type.

  19. Only one statement can be written in one row for troubleshooting.

  20. The content should be aligned when it is expanded by the same braces. Indentation must be performed between different braces.

  21. Intmain (){

  22. 1000-400;

  23. Return0;

  24. } -------------------------------> Writing specifications

  25. If gcc File Name translation is complete, nothing is successful.

  26. ./Write a. out strictly.

  27. Note // a movie ticket of 30 yuan calculates the price of three movie tickets

  28. In C language programs, you can use annotations to record text information.

  29. A single line comment starts with a slash (//). All subsequent content is treated as text information, and only one line of content is affected.

  30. /*

  31. Multi-line comments are ignored no matter how much content is written.

1. Author: syt

2. Date: 2013.09.24

3. Version 1.0

  1. */

  2. Multi-line comments start with/* and end */

  3. Let the computer tell us some operation data.

  4. C language provides a set of standard functions, which are used to complete some common functions. Each standard function has its own big name. Different standard functions have different big names. The program uses function call statements to call standard functions.

  • The name of the big standard function used to print information on the screen is printf, which is used to separate different information.

  1. Use the standard function in the program using the function call statement

  2. Placeholder % dprintf ("% d \ n", 1); 1 to replace this placeholder

  3. You can use placeholders to print the numbers temporarily calculated in the program to the screen.

  4. Variables are the only tool in the program used to record information.

  5. A variable represents a storage location in a computer.

  6. A variable can only store records) data in a group.

  7. Variables must be declared using declaration statements before they can be used.

  8. /*

  1. Variable contact

  1. */

  1. # Include <stdio. h>

  1. Intmain (){

  1. Intnum;

  1. Num = 4; // = value assignment operator. The order cannot be reversed.

  1. Return0;

  1. }

  1. The left side of the value assignment operator must be a variable. The right side of the value assignment operator is anything that can be used as a number.

  2. Variables can be used directly as numbers in a program.

  3. Only assigning values to variables changes the content of variables.

  4. Multiple variables of the same type can be declared using one statement.

  5. The variable name can represent both variables and numbers. The specific function is determined by the environment.

  6. If no value is assigned to a variable, the integer value is: unpredictable -------------. When declaring a variable, the value is assigned to the variable to clear the number in the storage location.

  7. There must be numbers at any time for any storage.

  8. The variable must be initialized and assigned immediately when the variable is declared)

  9. Variables can be used to indicate numbers that are completely unknown during programming. --- Equivalent to an unknown number in Mathematics

  10. A variable can also be used to represent a set of regular numbers. Once used up, the variable is no longer used.

  11. In the process of using variables, the change rules are written in the program, instead of assigning values to the calculated values.

  12. 2yy6p

  13. Print 1361015

This article from the "Know what it does not" blog, please be sure to keep this source http://shenyantao.blog.51cto.com/1957956/1303265

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.