📄 pointfun.c
字号:
#include <stdio.h>void change (int *p);//prototype says that change will not return a value and it expects//to be given a pointer to an integer, i.e. the address of an integerint main (){ int var = 5; printf("Before change, var is %i \n", var); change(&var); //call the function change. Send it the address of var printf("After change, var is %i\n", var); return 0;}void change (int *p){ *p *= 100; // what p points to becomes itself * 100 printf("In change, *p is %i\n", *p); //change doesn't know anything about var //but it does know the place p points to}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -