CS208 Introduction to Computer Systems Wednesday, 5 April 2023 + Queues questions + One pedagogical goal: independence - Using documentation (e.g., strncpy) - Reading specifications (e.g., q_insert_tail) - Experimenting (e.g., strncpy) + C structs - What are they? - typedef - . vs. -> - like classes, but without methods - "box of data" - "fields" vs. "instance variables" + Recap: Memory organization of a C program - "text" -- instructions (fixed-size at compile time, read-only) - initialized data (fixed-size at compile time, read-only) - global variables (fixed-size at compile time, read-write) - heap (space you allocate via malloc) - system stack (local variables & function parameters) (grows from high addresses towards lower) + Recap: Memory & C pointers - Variables have types - You can "typecast" some variables from one type to another - Declaring a variable - Defining a variable - Declaring/defining/initializing pointers - Initializing a variable - The & unary operator - The * unary operator + Break + Data representation - integers, characters, real numbers - integers - "unsigned" integers - uh-oh: "byte order"/"endian-ness" - characters - ASCII - Unicode - encodings: UTF-16 - byte order