update pointer.c

This commit is contained in:
juan 2021-10-09 10:03:10 +08:00
parent b5ef82343c
commit a77b21b893
No known key found for this signature in database
GPG key ID: 5C1E5093C74F1DC7

View file

@ -3,13 +3,8 @@
int main(void) {
// initialize pointer variables
char *str;
char str1[20];
str = &str1;
strcpy(str1, str);
printf("%s\n", str1);
printf("%s\n", str1);
printf("%i\n", *str);
int i = 1;
int *p1 = &i;
printf("%i", *p1);
return 0;
}