CPSC 225, Spring 2003 Information about the Second Test ---------------------------------------------------------------------------- The second test in this course will be given in class on Monday, March 3. It covers everything that we have done since the previous test. This includes Sections 5.3 and 5.4; Chapter 6; Section 7.1; Chapter 10; and the basic ideas of C-style strings from Chapter 9. (While there will be no questions specifically targeted at material from the first test, you do, of course, need to remember all the basics of variables, types, control structures, and functions.) Here are some of the terms and ideas that you should be familiar with: Partially-full arrays Multi-dimensional arrays Layout of two-dimensional arrays in memory Locating an array element A[i][j] in memory Two-dimensional array types, such as int[][12] Two-dimensional array parameters Initializers for two-dimensional arrays Processing of two-dimensional arrays The Game of Life [if you need to know the rules, I will give them to you] Enumerated types using "enum" Syntax of "struct" and "class" declarations Using "struct" and "class" to define new types Classes and objects Public and private members of classes Using "struct" and "class" types (for declaring variables, parameters, and return values) Accessing members of structs and objects with the "." operator Layout of an array of structs in memory Arrays of structs or objects Defining member functions (outside of the class declaration) The :: operator Constructors Default constructor (with no parameters) Constructors with default parameters (E.g.: Point2D(int x=0, int y=0) ) Calling a constructor to initialize a variable (E.g.: Point2D pt(3,5);) Accessor and mutator methods Designing with classes (object-oriented programming) Pointers Pointer variables; declaring pointer variables The "*" prefix operator (E.g.: *ptr = 17; ) The and "&" prefix operators (E.g.: ptr = &x; ) Assignment and comparison of pointers with =, ==, and != Parameter passing by pointer (E.g.: void swap(int *p, int *q) ) The "new" operator The heap Calling a constructor with the new operator The "delete" operator Memory leaks Dynamic arrays Relationship of pointers to array variables Using the "new" operator to create dynamic arrays The "delete[]" operator Destructors Using pointers with objects (E.g. (*obj).memb ) The -> operator (E.g. obj->memb ) C-style strings, and how they are represented The null character, with ASCII code zero The type char* for C-style string variables