Created
June 4, 2013 06:39
-
-
Save ustbgaofan/5704010 to your computer and use it in GitHub Desktop.
指针 1)指针在本质上也是一个变量
2) 指针需要占用一定的内存空间
3) 指针用于保存内存地址的值 4)不同类型的指针占用的内存空间大小相同
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i; | |
int* pI; | |
char* pC; | |
float* pF; | |
pI=&i; | |
printf("%d,%d,%0X\n",sizeof(int *),sizeof(pI),&pI); | |
printf("%d,%d,%0X\n",sizeof(char *),sizeof(pC),&pC); | |
printf("%d,%d,%0X\n",sizeof(float *),sizeof(pF),&pF); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment