CS208 Introduction to Computer Systems Wednesday, 29 March 2023 + Today - Bits, bytes - Integers in base 2 (binary), 8 (octal), 10 (decimal), and 16 (hexadecimal) - char arrays, strings, and the wild proliferation of array notations in C - pointers, *, & - Questions - 2D arrays in C + Integer notations [10-12 minutes] - Binary: relation to physical devices, computational benefits, 0b notation - Octal: 3-bit chunks, 0 notation, %o - Hexadecimal: 4-bit chunks, 0x notation, as seen in RGB color representation, %x, %X - bits, bytes, words - od (Unix command) - hexdump (Unix command) + Memory - Big box o' bytes with addresses - What's the meaning of a byte? Context decides. + C strings [10-15 minutes] - strings.c - * vs. [] - const + Addresses ("pointers") in C - pointers.c - &: the "address-of" operator - * in declarations: "a pointer to" - * applied to a pointer: "value at this address" - Array names are pointers. (That doesn't seem fair.) + Questions [N minutes] - "Starting C" assignment - C in general - Anything else + arrays2d.c - 2D arrays are simple in C, except if you pass them as parameters to functions - row-major order - grid vs. grid[j] vs. grid[j][k]