vault backup: 2024-10-08 20:48:52
This commit is contained in:
parent
7f1a463b11
commit
86345fe676
@ -1,3 +1,13 @@
|
|||||||
> 1. We discussed using the expression `sizeof(a) / sizeof(a[0]` to calculate the number of elements in an array. The expression `sizeof(a) / sizeof(t)` where `t` is the type of `a`'s elements would also work, but it's considered an inferior technique. Why?
|
> 1. We discussed using the expression `sizeof(a) / sizeof(a[0]` to calculate the number of elements in an array. The expression `sizeof(a) / sizeof(t)` where `t` is the type of `a`'s elements would also work, but it's considered an inferior technique. Why?
|
||||||
|
|
||||||
> 3. Write a declaration of
|
> 3. Write a declaration of an array named weekend containing seven `bool` values. Include an initialize that makes the first and last values `true`; all other values should be `false`.
|
||||||
|
|
||||||
|
> 6. Calculators, watches, and other electronic devices often rely on 7 segment displays for numerical output. To form a digit, such devices turn on some of the seven segments while leaving others off.
|
||||||
|
>
|
||||||
|
> Here's what the array might look like, with each row representing one digit:
|
||||||
|
```
|
||||||
|
const int segments[10][7] = {{1, 1, 1, 1, 1, 1, 0}, ...};
|
||||||
|
```
|
||||||
|
> I've given you the first row of the initializer, fill in the rest.
|
||||||
|
|
||||||
|
> 1. Write a declaration for an 8x8 `char` array named `chess_board`. Include an initializer that puts the follwoing data into the array, one char
|
Loading…
Reference in New Issue
Block a user