CS120 - Extra Material ------------------------ Read (here and in the text) and feel free to experiment with these concepts. However, we will not hold you responsible for them. - pointers to functions (cool!) - useful for menu driven things - functions must be of same type & same parameter types - unions - similar to structures, but share space, only one part at a time - define, declare - assign members, take address, access members with . and -> - can only initialize value of first element type in declaration - can access any part, but must be consistent until next part assigned - bitfields to conserve memory, declare as int or unsigned struct example { unsigned a: 13; unsigned : 3; /* used as padding */ unsigned b : 4; }; - #define MACRO_NAME(args) (macro expression) eg, #define CIRCUM(x, y) (2 * (x) + 2 * (y)) - make sure to put args in () - #undef - system calls system("ls");