标题:哪位大侠能帮我解答一下这个关于指针的问题?
取消只看楼主
指向指针的指针
Rank: 1
等 级:新手上路
帖 子:339
专家分:0
注 册:2004-8-8
 问题点数:0 回复次数:2 
哪位大侠能帮我解答一下这个关于指针的问题?

各位大侠声明一个指针(int *p;)后是不是系统就给这个指针自动分配了个地址?这个地址是什么?没有用的?是不是*p就可能覆盖了这个地址原有的数据?

是不是 *p=77; 是错误的? 如果 int a=77; *p=a; 错了没有?? 那 int a=77; p=&a; 是对是错?

搜索更多相关主题的帖子: 指针 解答 
2004-08-10 20:11
指向指针的指针
Rank: 1
等 级:新手上路
帖 子:339
专家分:0
注 册:2004-8-8
得分:0 
到底int *p之后分配地址了没有?是随机分配?地址是NULL?

/sign.png" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./sign.png');}" onmousewheel="return imgzoom(this);" alt="" />
2004-08-11 16:18
指向指针的指针
Rank: 1
等 级:新手上路
帖 子:339
专家分:0
注 册:2004-8-8
得分:0 

int a=77

int *p=&a

这样有错吗?


/sign.png" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./sign.png');}" onmousewheel="return imgzoom(this);" alt="" />
2004-08-11 17:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-4112-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.437089 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved