## WHY MEMORY POSITIONS DO NOT APPEAR IN HEXADECIMAL

Alberto Rosello
Posts: 4
Joined: Mon Aug 06, 2018 10:45 pm

### WHY MEMORY POSITIONS DO NOT APPEAR IN HEXADECIMAL

is a small program of direction visualization of an array of 10 numbers through pointers, as you know a pointer must store the consecutive addresses of the arrangement, but I get the surprise that for example jumps from position 68 to 72 and passes overlook position 6C (hexadecimal numbers are not listed !!!)

Can someone please explain this to me?

I enclose the result where the memory addresses are shown

Attachments
memory.jpg (67.02 KiB) Viewed 1015 times

procount
Posts: 1415
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

### Re: WHY MEMORY POSITIONS DO NOT APPEAR IN HEXADECIMAL

Maybe because ALL the memory addresses are being shown in decimal?

(Hexadecimal numbers without letters are not the same as decimal numbers - they are still hexadecimal. They are usually prefixed with 0x so you can tell the difference and interpret them correctly.)
Last edited by procount on Tue Aug 07, 2018 10:04 am, edited 1 time in total.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Heater
Posts: 10839
Joined: Tue Jul 17, 2012 3:02 pm

### Re: WHY MEMORY POSITIONS DO NOT APPEAR IN HEXADECIMAL

I'm pretty sure all those numbers are decimal. Notice how the increment by 4 each time, which is what we might expect if the pointer is to integer data or machine instructions.

How are you printing those numbers?

If you are using printf() from C, for example, you will need the correct format specifier for hexadecimal output. Google it.

Why is you post title all in upper case characters?

6by9
Raspberry Pi Engineer & Forum Moderator
Posts: 6214
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

### Re: WHY MEMORY POSITIONS DO NOT APPEAR IN HEXADECIMAL

Heater wrote:
Tue Aug 07, 2018 7:55 am
If you are using printf() from C, for example, you will need the correct format specifier for hexadecimal output. Google it.
Or do

Code: Select all

man 3 printf
to print out the manual page for printf.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.