Week 1 Flashcards
What are the 4 most common types of the C language for performing arithmetic calculations?
Char
Int
Float
Double
What is a type?
A rule that defines how to store values in memory and which operations are admissible on those values.
What is a char?
Occupies one byte and can store a small integer value, a single character, or a single symbol
What is an int?
Occupies one word and can store an integer value. In a 32 bit environment, an int occupies 4 bytes.
What is a float?
Typically occupies 4 bytes and can store a single-precision, floating point number
What is a double?
Typically occupies 8 bytes and can store a double-precision, floating point number.
What is a size specifier?
Adjusts the size of the int and double types
What are the 3 type int size specifiers?
Short
Long
Long Long
How many bits does a short int contain?
At least 16 bits
How many bits does a long int contain?
At least 32 bits
How many bits does a long long int contain?
At least 64 bits
What is a const qualifier?
Any type that can hold a constant value. A constant value cannot be changed. To qualify a type as holding a constant value, use the keyword const. A const is unmodifiable.
What are the 2 integral types? What are the 2 floating-point types?
Integral types: char, int
Floating-point types: float, double
How are integral types stored?
The integral types (char and int) are stored in equivalent binary form. Binary form represents the value stored exactly. The integral types are short, long, signed, unsigned, and plain ints.
How are floating-point types stored?
Stored as tiny and big values from being separated into three components: a sign, an exponent, and a significand.