Skip to content

Commit 82b87dd

Browse files
author
Mr.Zhao
committed
强制类型转换
1 parent 213ba97 commit 82b87dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cut.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdio.h>
2+
3+
int main(void)
4+
{
5+
char a[10] = {0,1,2,3,4,5,6,7,8,9};
6+
short *p = (short *)(a+2);
7+
short i = *p;
8+
printf("%x\n", i);
9+
printf("%p\n", a);
10+
printf("%p\n", a + 1);
11+
12+
return 0;
13+
}

0 commit comments

Comments
 (0)