Toggle navigation
New
Learn
Snippets
Meta
News
About
API Docs
Source Code
Account
Register
Login
指针的大小比较
main.c
dio.c
✖
tria.c
✖
tessera.c
✖
pente.c
✖
eksi.c
✖
Run Settings
Language
C
Language Version
latest
Run Command
Snippet Metadata
Owner
Qwas
Created
Modified
Visibility
Public
#include <stdio.h> int main(void) { // 声明一个大小为9的int类型数组sz,并对其中元素初始化 int sz[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; for (int *p = &sz[0]; p <= &sz[8]; p++) { printf("%d ", *p); // 间接访问 输出p 指向单元中的数据 } } /** 两个毫无关联的指针比较大小是没有意义的,因为指针只代表“位置”信息 如果两个指针所指向的元素位于同一个数组,或同一块动态申请的内存中,指针的大小能反映元素在数组中的先后顺序 */ /* 类似于 https://glot.io/snippets/gvlu2eh0hb */
Editor Settings
Theme
Chrome
Clouds
Crimson Editor
Dawn
Dreamweaver
Eclipse
GitHub
Solarized Light
TextMate
Tomorrow
XCode
Kuroir
KatzenMilch
Ambiance
Chaos
Clouds Midnight
Cobalt
idle Fingers
krTheme
Merbivore
Merbivore Soft
Mono Industrial
Monokai
Pastel on dark
Solarized Dark
Terminal
Tomorrow Night
Tomorrow Night Blue
Tomorrow Night Bright
Tomorrow Night 80s
Twilight
Vibrant Ink
Key bindings
Default
Vim
Emacs
Full width
True
False
Lines
-
Auto
+
Direct link
Raw
Embed