From a77b21b893fa52585d75c3d551873485aa46ef50 Mon Sep 17 00:00:00 2001 From: juan Date: Sat, 9 Oct 2021 10:03:10 +0800 Subject: [PATCH] update pointer.c --- pointers.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pointers.c b/pointers.c index 6eda79a..d2867e1 100644 --- a/pointers.c +++ b/pointers.c @@ -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; }