Introduction to Chapter 3
- Chapter 3 is easy and hard.
- It is easy because it it still about data types.
- It is hard because most of these data types are numbers.
- She has a figure that shows all of the data types in c++
-
- Note character (char) is listed as an integer type
- And strings are not listed at all?
- Remember, characters are just the ascii value
- So the data stored there is actually an integer type.
- This is treated different than all other integer types for I/O
- But as an integer in every other way.
- Strings are not really a built in data type
- They are an example of a class, sometimes called objects.
- We will study a little more about strings in this chapter.
- We will study objects in CSCI 230 and CSCI 330
- We have started to learn about another class, the stream
- We have examples of cin and cout.
- These are data streams.
- Rounding out the tree
- Simple data types hold a single value.
- We will mostly address these in chapter 3.
- But enums will be the start of 230
- Structured data types can hold multiple values.
- These will mostly be addressed in 230
- Addresses point to other data.
- Integer types hold integers
- floating point types hold real numbers.
- Both floats and ints have different "sized" values.
- For integers
- A bit is a 0 or a 1.
- A
char
is 8 bits.
- A
short
is bigger than a char (usually 16 bits)
- An
int
is bigger than a short (usually 32 bits)
- A
long
is bigger than an int (but possibly not)
- A bool is wierd, different and useful in chapter 5.
- Floats are the same but the names are
- And integers can be signed or unsigned.