Data Types
Signed / Unsigned Int
<climits>
<cstdint>
<iostream> and std
100

What is the size of an Int data type?
What data does it hold?

32b

whole numbers
100

What is the max value of a signed 32b int?

(2^31)-1

100
What does <climits> provide?
Limits for Min/Max values of varying data types

(INT_MIN, INT_MAX, etc)

100

int8_t holds how much data?

What kind of data?

8b

Signed Integer (Whole #s)

100

What does including iostream do?

I/O (input and output)

Mainly this is cout and cin

200

What is the size of a Double data type?
What data does it hold?

64b

floating point

200
What is the max value of an unsigned 32b int?
2^(32)-1
200

int a = INT_MAX;

a++;

cout << a << endl;

What is the value of a?

INT_MIN or -(2^31)

200

uint16_t holds how much data?

What kind of data?

16b

Unsigned integer, so non negative whole #s

200
How do we cout multiple elements in a single cout command?

Break them up using <<

Ex/ cout << "Hello " << "World! " << 42;
300

What is the size of a Bool data type?
What data does it hold?

8b

True or False

300

What formulas can be used to find the max/min size of a signed int?

Max: 2^(b-1)-1

Min: -(2^(b-1))

300

int a = INT_MIN;

a--;

cout << a << endl;

What is the value of a?

INT_MAX or (2^31)-1

300

What is the max value an uint64_t can hold?

(2^64)-1
300

What command from <iostream> allows for user input on the command line?

cin

Ex/ cin >> a;

400

This data type holds a smart array of characters.

Can it be used without being included? (#include<...>)

String

No, must be included as #include<string>

400

What formulas can be used to find the max/min size of an unsigned int?

Min: 0

Max: (2^b)-1

400

unsigned int a = 0;

a--;

cout << a << endl;

What is the value of a?

UINT_MAX or (2^32)-1

400

unsigned int = what cstdint data type

uint32_t

400

Debug the small program:

#include<iostream>

int main() {

cout << "Hello World!";

return 1;

}
It is not using namespace std;

So cout requires std:: added to them

500

What is the difference between long long and long long int?

Nothing, they are the exact same. Adding Int is unnecessary.

500

Without using <cstdint> how can you create an unsigned int32?

unsigned int a;

500

uint8_t val = 254;

val++;

What is the value of val?


255 :)

500

When making an int using <cstdint> what format can you follow?


ex/ int8_t, uint16_t, etc

If signed: add nothing

If unsigned: add u

Then add int

Then add size (8,16,32,64)

Then add _t 

500

What does the code do, (assume namespace std and iostream/string)

string s;

cin >> s;

cout << "Hello, " << s;

Allows user input (cin) for string s, then states "Hello, " then s.