Question about Memory lecture 1

142 views
Skip to first unread message

Ryan Tio

unread,
Sep 8, 2020, 4:19:32 PM9/8/20
to cmpt-295-sfu
Hi Arrvindh,

I was looking at the lecture video for memory 1, and I was wondering why 0000beefdeadbeef displays in the reverse order when you are printing the ascending memory addresses. It seems like it is the opposite of the expected behaviour.

Intuitively, it feels like it should be 00 at 2e68, 00 at 2e69, and then be at 2e6a, but it is reversed. Is there a reason for this?

Is x stored in reverse order, or does the pointer point to a different location in memory than I am expecting?

Ryan Tio

unread,
Sep 8, 2020, 4:27:55 PM9/8/20
to cmpt-295-sfu
Oh, I progressed further into the lecture, so I am guessing that C uses a 'little endian' system.

Artun

unread,
Sep 8, 2020, 9:22:47 PM9/8/20
to cmpt-295-sfu
Yes your computer system uses the little-endian system, it doesn't have anything to do with C which is just a language.

Arrvindh Shriraman

unread,
Sep 9, 2020, 12:08:03 AM9/9/20
to cmpt-295-sfu
+1
Reply all
Reply to author
Forward
0 new messages