We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e1783c commit 2342df0Copy full SHA for 2342df0
tests/testcases/valid/expressions/07_pointer_array_access.ciel
@@ -9,7 +9,7 @@ int main() {
9
// Pointer to array
10
int arr[10];
11
int* ptr;
12
- ptr = arr;
+ ptr = &arr[0]; // Explicitly take address of first element instead of relying on array decay
13
14
ptr[0] = 5;
15
ptr[1] = 10;
@@ -64,7 +64,7 @@ int main() {
64
// Pointer to struct array
65
struct Point point_arr[5];
66
struct Point* pstruct;
67
- pstruct = point_arr;
+ pstruct = &point_arr[0]; // Explicitly take address of first element instead of relying on array decay
68
69
pstruct[0].x = 10;
70
pstruct[0].y = 20;
0 commit comments