Commit 575349c
committed
feat: Illustrate array declaration, initialization, element update, and increment behavior
🧠 Logic:
- Declares arrays in various formats: with size, inline initialization, and deferred allocation.
- Updates B[2] = 15 to demonstrate element modification.
- Uses a for loop to print and increment each element of B (post-increment prints original value).
- Uses a for-each loop with post-increment (x++), which increments a copy, not the actual array.
- Comments explain behavior clearly for learning purposes.
Signed-off-by: Somesh diwan <[email protected]>1 parent a9990cf commit 575349c
1 file changed
+10
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 9 | + | |
16 | 10 | | |
17 | 11 | | |
18 | 12 | | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 16 | + | |
| 17 | + | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
28 | | - | |
29 | | - | |
| 21 | + | |
30 | 22 | | |
31 | 23 | | |
32 | | - | |
33 | 24 | | |
34 | | - | |
| 25 | + | |
0 commit comments