This commit is contained in:
Luca Conte 2023-11-08 12:06:47 +01:00
parent 38965f3dd6
commit 301d85f1a3
1 changed files with 14 additions and 0 deletions

14
a4.7/copyarray.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
int main(void) {
int a[5] = {1, 2, 3, 4, 5};
int b[5];
for (int i = 0; i < 5; i++) {
*(b + i) = *(a + 4 - i);
}
for (int i = 0; i < 5; i++) {
printf("%d\n", b[i]);
}
}