Experiment nine--basic data type storage and application summary

Source: Internet
Author: User
Tags array definition

First, this lesson to learn the point of knowledge:

1, this lesson by starting from the data in the computer storage format, introduced the integer, character, single-precision and double-precision four kinds of basic data types of storage methods.

2, through the example introduced four kinds of basic data type definition, the value range and the constant form, requires the emphasis to grasp the ASCII character set and the escape character application.

3, through the example of how to complete the input and output of the data through function call in C language, can skillfully use scanf (), printf (), GetChar () and Putchar () these four basic input and output functions, focusing on the format control specifier.

4. Integers in the C language have decimal, octal, and hexadecimal three representations. The first number must be preceded by a prefix of 0x or 0X.

5, constants, variables, functions is the simplest expression, with the operator to correctly connect the expression is also an expression.

Second, the experimental process encountered problems and solutions:

1, for the conversion of the system is not very clear, also not very will calculate.

2, for the example of this chapter and practice experiment also some not quite understand.

3, the solution: the corresponding results are modified, tried or consulted data.

Iii. experience of experiment and summary of the study in this chapter

This class study, I listen to a bit of a confused, because this lesson is a bit more, I accept the ability to slow, so I need to slowly after class to ponder.

This chapter studies the summary:

1. Data storage and basic data types: integral type and integer constant character and character type constant

2, data input and output: through the function call to achieve.

Input and output of input and output data for integer data inputs and outputs of character type data

The input Format control specification for double type data must be%LF or%le.

3. Type conversion: Automatic type conversion forced type conversion

4. Expressions: Constants, variables, functions are the simplest expressions, and the expressions that are correctly connected with an operator are expression.

Arithmetic operator precedence and binding assignment expression Relationship expression logical expression Comma expression bit operation other operation.

Iv. Preview: Arrays

1, the array is the most basic construction type, it is a set of the same type of data in an orderly combination. The elements in the array are kept in memory, each element is of the same data type, and array elements can be uniquely determined with array names and subscripts.

2. Definition and reference of a one-dimensional array: Defines an array that requires explicit array variable names, the type of array elements, and the size of the arrays.

The general form of a one-dimensional array definition is: Type an array group name [array length];

The type name specifies the type of each element in the array, the array name is the name of the array variable, is a valid identifier, and the array length is an integer constant expression that sets the size of the array. The array length is a constant. Array subscript starting from 0, subscript cannot be crossed.

The array name is an address constant that holds the first address of the array memory space.

3. Initialization of one-dimensional arrays: As with the initialization of simple variables, when you define an array, you can also assign an initial value to a group element.

The general form is: Type an array group name [array length]=[initial value table];

4, the application of the array can not be separated from circulation. The subscript of an array is used as a loop variable, which can be processed one-by-one for all elements of a group.

Experiment nine--basic data type storage and application summary

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.