DEMO9S08SH32 Pointers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DEMO9S08SH32 Pointers

Jump to solution
1,165 Views
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.

Labels (1)
0 Kudos
1 Solution
341 Views
tonyp
Senior Contributor II

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

 

View solution in original post

0 Kudos
2 Replies
342 Views
tonyp
Senior Contributor II

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

 

0 Kudos
341 Views
Coyote
Contributor I

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

0 Kudos