#include <stdio.h>
#include <stdlib.h>
int main() {
int a = 10;
int *p = &a;
printf("%d\n", a);
printf("%p\n", &a);
printf("%d\n", *p);
*p = 30;
printf("%d\n", a);
printf("-----------------------------------------------\n");
int arr[3] = {10, 20, 30};
int *p1 = arr;
printf("%d\n", *p1);
printf("%d\n", *(p1+1));
printf("%d\n", *(p1+2));
printf("-----------------------------------------------\n");
int *p2 = malloc(sizeof(int)*4);
if (p2==NULL) return 1;
p2[0] = 10;
p2[1] = 20;
free(p2);
p2 = NULL;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: