This commit is contained in:
2023-09-30 17:46:22 +03:00
parent f3602b1fb8
commit 3e99badb38
4 changed files with 143 additions and 0 deletions

29
learnc/learnc14.c Executable file
View File

@ -0,0 +1,29 @@
#include <stdio.h>
int main() {
int intarray[5] = {10,20,30,40,50};
//-----------------------^
int *pointer = &intarray[2];
// Array of 3 pointers
int *parray[3];
// Copy last three addresses of intarray into parray
// Use parray and pointer
int i;
for (i = 0; i < 3; i++) {
// Insert code here
parray[i] = pointer + i;
}
// Test code
for (i = 0; i < 3; i++) {
if (parray[i] == &pointer[i]) {
printf("Matched!\n");
} else {
printf("Fail\n");
}
}
return 0;
}