指针加减整数

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> int main(void) { int sz[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; int *p = &sz[0]; for (int i = 0; i < 9; i++) { printf("%d ", *p); p++; } } /** * 指针+整数 : 将指针向后移动 "sizeof(指针类型)*整数"个内存单元 * 指针-整数 : 将指针向前移动 "sizeof(指针类型)*整数"个内存单元 **/
Editor Settings
Theme
Key bindings
Full width
Lines