CSE 232 Lab 2 Notes 1. Sizes of Primitive Types Size of integer data objects (in bytes) short: 2 int: 4 long: 8 Size of floating point data objects (in bytes) float: 4 double: 8 Size of other data objects (in bytes) char: 1 bool: 1 void*: 8 Note: void* is a pointer to a variable of unspecified type. all pointers are the same size. 2. Typecasting For our purposes, the following notations are identical: C notation: (int)x function notation: int(x) You will not enounted any differences in 232. 3. Increment/Decrement x++ or ++x alone same as "x = x + 1;" x-- or --x alone same as "x = x - 1;" But they are different on the right side of assignment. y = x++; same as y = x; x = x + 1; y = ++x; same as x = x + 1; y = x; 4. Variable Initialization int x = 3; same as int x; x = 3; It's usually better to use the initialization notation. 5. Variable Name Conventions I recommend the following conventions, which are used in both C++ and Java. variables and functions: someObject, someFunction class names: ClassName constants: SOME_CONSTANT Otherwise, immitate the conventions in the examples and labs. Try not to mix styles in the same file.