C
x
21
1
2
3
void Array_Fill(int array[], size_t size, int value) {
4
if (array != NULL)
5
for(size_t i = 0; i < size; ++i )
6
array [i] = value;
7
array[6] = 5.00;
8
printf("%d,\n", value);
9
}
10
11
int main(void) {
12
int array[] = {5, 7, 15, 35, 81, 51, 0};
13
for (int i = 0; i < 6; i++) printf("%d, ", array[i]);
14
puts("");
15
Array_Fill(array, 6, 7);
16
for (int i = 0; i < 6; i++) printf("%d, ", array[i]);
17
puts("");
18
return 0;
19
}
20
21
$ gcc prog.c -Wall -Wextra -O2 -march=native -std=c99 -pedantic
Start
5, 7, 15, 35, 81, 51, 7, 7, 7, 7, 7, 7, 7,
0
Finish