Simple Pointer Question
From: trustron (member46534_at_dbforums.com)
Date: 10/31/03
- Next message: Christian Brechbühler: "Re: constructor syntax"
- Previous message: Miroslav Novak: "template and nested class problem"
- Next in thread: Gary Labowitz: "Re: Simple Pointer Question"
- Reply: Gary Labowitz: "Re: Simple Pointer Question"
- Reply: Gianni Mariani: "Re: Simple Pointer Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Christian Brechbühler: "Re: constructor syntax"
- Previous message: Miroslav Novak: "template and nested class problem"
- Next in thread: Gary Labowitz: "Re: Simple Pointer Question"
- Reply: Gary Labowitz: "Re: Simple Pointer Question"
- Reply: Gianni Mariani: "Re: Simple Pointer Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]