tailieunhanh - Module 2 Introducing Data Types and Operators

At the core of a programming language are its data types and operators. These elements define the limits of a language and determine the kind of tasks to which it can be applied. As you might expect, C++ supports a rich assortment of both data types and operators, making it suitable for a wide range of programming. Data types and operators are a large subject. We will begin here with an examination of C++’s foundational data types and its most commonly used operators. We will also take a closer look at variables and examine the expression | Module 2 Introducing Data Types and Operators Table of Contents CRITICAL SKILL The C Data Project 2-1 Talking to CRITICAL SKILL CRITICAL SKILL A Closer Look at CRITICAL SKILL Arithmetic CRITICAL SKILL Relational and Logical Project 2-2 Construct an XOR Logical CRITICAL SKILL The Assignment CRITICAL SKILL Compound CRITICAL SKILL Type Conversion in CRITICAL SKILL Type Conversion in CRITICAL SKILL CRITICAL SKILL Spacing and Project 2-3 Compute the Regular Payments on a At the core of a programming language are its data types and operators. These elements define the limits of a language and determine the kind of tasks to which it can be applied. As you might expect C supports a rich assortment of both data types and operators making it suitable for a wide range of programming. Data types and operators are a large subject. We will begin here with an examination of C s foundational data types and its most commonly used operators. We will also take a closer look at variables and examine the expression. 1 C A Beginner s Guide by Herbert Schildt Why Data Types Are Important The data type of a variable is important because it determines the operations that are allowed and the range of values that can be stored. C defines several types of data and each type has unique characteristics. Because data types differ all variables must be declared prior to their use and a variable declaration always includes a type specifier. The compiler requires this information in order to generate correct code. In C there is no concept of a type-less variable. A second reason that data types are important to C programming is that several of the basic types are closely tied to the building blocks upon which the computer operates bytes and words. Thus C lets you operate on the same .

TỪ KHÓA LIÊN QUAN