EECS 183 Lecture Notes - Lecture 12: Readwrite, Base Address, Array Data Structure
1
EECS 183 Full Course Notes
Verified Note
1 document
Document Summary
This only compares addresses, not the individual elements. Best solution is to use for loop. This prints all the elements in array. This is always passed by reference, no & needed. This is because it"ll take too much time to copy the values. Saves processing time (array elements aren"t copied) To prevent function from modifying an array put const in front of array in parameter. Single array element is passed by value. Initializing it: #row and #col still need to be constants, not variables. Initialize multidimensional arrays by grouping together initializers for each dimension. Or initialize with loops (two for loops. When passing multidimensional array, all but the first dimension is required. This is because, to determine how much to offset for the first dimension, the compiler will only need to look at the array type. However, to determine how much to offset for the other dimensions, the compiler needs to know the actual size of the dimensions.