feat: update structure

This commit is contained in:
2024-01-22 14:27:40 +08:00
parent 7836c9185c
commit 3544a28a2e
559 changed files with 120846 additions and 4102 deletions

View File

@@ -0,0 +1,31 @@
#include <stdio.h>
int (*fptr)(int);
int func(int x) {
return 2 * x;
}
int y = 10;
int *(*pfptr)();
int *func2() {
return &y;
}
int main() {
printf("Calling func with value 6: %d\n", func(6));
printf("Now setting fptr to point to func.\n");
fptr = func;
printf("Caling fptr with value 6: %d\n", fptr(6));
printf("\nNow caling func2 which returns the address of global variable y: %p\n", func2());
printf("Pointing pfptr to func2.\n");
pfptr = func2;
printf("Now calling fpfptr: %p\n", pfptr());
}