DEMO9S08SH32 Pointers

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

DEMO9S08SH32 Pointers

跳至解决方案
1,807 次查看
Coyote
Contributor I

Hello,
I am new to this forum, I bought a DEMO9S08SH32 to various tests.
 I have a problem with pointers in language C, for example:

int *p1;

(void) main(void)
{

 ----

 *p1= 0;

 ----
}

The result to CodeWarrior is: *p1= 0x2e00 ?
I think normaly is: *p1= 0x0000 !

Thany you for your answer.

标签 (1)
0 项奖励
回复
1 解答
983 次查看
tonyp
Senior Contributor II

p1 is a(n uninitialized) pointer to an integer, not the variable that actually holds the value.

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
984 次查看
tonyp
Senior Contributor II

p1 is a(n uninitialized) pointer to an integer, not the variable that actually holds the value.

 

0 项奖励
回复
983 次查看
Coyote
Contributor I

Thank you for your answer, if I understand "int *P1" is only a variable that contains the adress of variables!

0 项奖励
回复