Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/c-pointers-arrays-strings/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Assume a 64-bit architecture where `short`s are 16 bits. When @code-array-sizeof
:::{note} Show Answer
:class: dropdown

Print output: `0 5 8`
Print output: `10 5 8`

* In Line 10, `sizeof(nums)` is in array’s declared scope. Evaluate to the total array size of five `short`s, i.e., 10.
* In Line 4, the value `len` is the result of evaluating `sizeof(nums)/sizeof(short)` in `main`, i.e., 10/2 = 5.
Expand Down Expand Up @@ -313,4 +313,4 @@ Choose formal parameter definitions wisely.
:::{warning} Reminder 4

Always pass in array lengths. See @sec-array-decay.
:::
:::