Simple Pointer Question

From: trustron (member46534_at_dbforums.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 08:31:16 -0500


Hi all,

I have got a pointer question. I was told that a pointer is a variable
holding a memory address.

SO:

..

//I: a variable holding a memory address

unsigned char U8 = 0xFFFF;

//II: a variable holding a memory address

unsigned char* pU8 = (unsigned char*)0xFFFF;

printf("U8 = %X \n",U8);

printf("pU8 = %X \n",pU8);

..

Output:

 U8 = FF

 pU8 = FFFF

I understand that U8 = FF (1 byte). I do not understand why pU8 = FFFF
(2 bytes), there is only 1 byte storage, so where is this number
(FFFF) stored?

--
Posted via http://dbforums.com