Closed sswangg closed 1 month ago
Thanks for reporting this issue!
It turns out that the exercise is well-formed, but it is out-of-date. I forgot to make an adjustment for this term. Prior to Fall 2024, EECS 280 used to cover raw arrays in C++, including a peculiar behavior called "array decay" where the compiler will insert an implicit conversion from an array to a pointer to its first element. So, an array of int may be passed to a function that takes an int *
parameter, as in the exercise.
However, I had intended to update this exercise so that it didn't depend on arrays, since we haven't covered them yet. I'll fix this in a moment (while also configuring the exercise to accept any answers from the old version as well for participation credit).
In the walkthrough video, only red(arr1) is determined to be "sus". However, red and teal are both functions which take in a pointer. Really, 4 of these function calls are erroneous. Perhaps the sample code should be