TYPES WEEK 2 Flashcards

1
Q

Description: Programming languages that use a type system to interpret bit streams in memory.

A

Title: Typed Programming Languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Description: A typed programming language that uses types to define how to store values in memory and which operations are allowed on those values.

A

Title: C Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Description: Rules that define how to store values in memory and which operations are admissible on those values.

A

Title: Types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Description: The four most common types in C for performing arithmetic calculations: char, int, float, and double.

A

Title: Arithmetic Types in C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Description: Occupies one byte and can store a small integer value, a single character, or a single symbol.

A

Title: Char Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Description: Occupies one word and can store an integer value. In a 32-bit environment, an int occupies 4 bytes.

A

Title: Int Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Description: Typically occupies 4 bytes and can store a single-precision, floating-point number.

A

Title: Float Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Description: Typically occupies 8 bytes and can store a double-precision, floating-point number.

A

Title: Double Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Description: Adjust the size of the int type. Three specifiers: short, long, long long.

A

Title: Size Specifiers for Int Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Description: Keyword used to qualify a type as holding a constant value. A const-qualified type is unmodifiable.

A

Title: Const Qualifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Description: Char and int types are stored in equivalent binary form.

A

Title: Integral Types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Description: Float and double types are used to represent floating-point data.

A

Title: Floating-Point Types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Description: Hardware manufacturers represent integral and floating-point data differently.

A

Title: Representing Values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Description: C stores characters and symbols in char types. The host platform provides a collating sequence for associating each character and symbol with a unique integer value.

A

Title: Characters and Symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Description: ASCII and EBCDIC are two popular collating sequences that are not compatible with each other. The Unicode standard provides a much more comprehensive collating system that is compatible with ASCII.

A

Title: Collating Sequences

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Description: Provides information on how to convert between decimal and binary representation.

A

Title: Appendix on Data Conversions

17
Q

Definition: There are three schemes for storing negative integers - 2’s complement notation (most popular), 1’s complement notation, and sign magnitude notation. All three represent non-negative values identically. To obtain the 2’s complement of an integer, flip the bits and add one.

A

Term: Negative Values (Optional)

18
Q

Definition: Floating-point types store tiny as well as huge values by decomposing the values into three distinct components - a sign, an exponent, and a significand. The most popular model is the IEEE (Institute of Electrical and Electronics Engineers) Standard 754 for Binary and Floating-Point Arithmetic. Under IEEE 754, a float has 32 bits, consisting of one sign bit, an 8-bit exponent, and a 23-bit significand, while a double occupies 64 bits, has one sign bit, an 11-bit exponent, and a 52-bit significand.

A

Term: Floating-Point Data

19
Q

Definition: The number of bytes allocated for a type determines the range of values that that type can store. For integral types, the ranges of values for some types depend on the execution environment. char (8 bits) can store values from -128 to 127 or 0 to 255, short (>= 16 bits) can store values from -32,768 to 32,767, int (2 or 4 bytes) can store values from -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647, long (>= 32 bits) can store values from -2,147,483,648 to 2,147,483,647, and long long (>= 64 bits) can store values from -9,233,372,036,854,775,808 to 9,233,372,036,854,775,807. For floating-point types, the limits on a float and double depend on the execution environment.

A

Term: Value Ranges

20
Q

Variable Declarations

We store program data in variables
A declaration associates a program variable with a type
The type identifies the properties of the variable
In C, a declaration takes the form: [const] type identifier [= initial value];
It is good practice to declare all variables at the beginning of the function and group related variables together

A

Variable Declarations

We store program data in variables
A declaration associates a program variable with a type
The type identifies the properties of the variable
In C, a declaration takes the form: [const] type identifier [= initial value];
It is good practice to declare all variables at the beginning of the function and group related variables together

21
Q

Multiple Declarations

Group variables of the same type in a single declaration
Separate the identifiers with commas

A

Multiple Declarations

Group variables of the same type in a single declaration
Separate the identifiers with commas

22
Q

Naming Conventions

Select identifier names that follow these naming conventions:
Starts with a letter or an underscore (_)
Contains any combination of letters, digits, and underscores
Less than 32 characters (varies by compiler)
Not a reserved word in C
Use good variable naming techniques
Avoid using reserved words

A

Naming Conventions

Select identifier names that follow these naming conventions:
Starts with a letter or an underscore (_)
Contains any combination of letters, digits, and underscores
Less than 32 characters (varies by compiler)
Not a reserved word in C
Use good variable naming techniques
Avoid using reserved words

23
Q

Reserved Words

Certain words are reserved in C and C++
These words should be avoided as variable identifiers
To ensure upward compatibility with C++, avoid certain C++ reserved words.

A

Reserved Words

Certain words are reserved in C and C++
These words should be avoided as variable identifiers
To ensure upward compatibility with C++, avoid certain C++ reserved words.