1570-T1 Flashcards
types of integers
short int, int, long int
short int
2 bytes, -32k to + 32k, max val of unsigned short is (2^16) + 1
int
usually 4 bytes, -2b to +2b
long int
4 bytes
types of floating point
float, double, long double
float
4 bytes, 6 sig figs
double
8 bytes, 15 sig figs
long double
19 sig figs (usually)
set output precision
include <iomanip>, cout << setprecision(# sig figs) << output</iomanip>
naming/identifiers
alpha numeric and underscore, cannot begin with number
non numeric types
character, string, boolean, (constant)
character
~2 bytes
string
~1 byte per char, cin stops at white space, need getline(cin, myString), also #include <string> for isupper(str), islower(str), and str. length()</string>
for non compatible types
static_cast <type> (the variable)</type>
ascii
alpha numeric and special chars, represented by 7 bit binary num, 128 cars defined