Live data from Hacker News

Basics of Memory Addresses in C

denniskubes.com

1–10 of 18 posts

Re: Basics of Memory Addresses in C

#3
Nice introduction. I think it is worth pointing out that much of what you discuss is implementation dependent, the c standard doesn't require an implementation to lay out data in memory in any particular way. Instead it requires that access semantics behave in a particular way. These semantics, in turn, align with easy, low level implementations.

Re: Basics of Memory Addresses in C

#4

I like the style, but it was basics indeed. I look forward to following parts. Something that initially confused me about sizeof on arrays is the somewhat deceiving parameter form `char s[]`.

Yeah I agree it is basic. I needed to layout some of these concepts before doing the deep dive on arrays. Writing that post now will be out in the next couple days.

Re: Basics of Memory Addresses in C

#7
One thing to note:

Maybe you should explain the first element of an array having the same memory address as the actual array a little bit more, and relate it to why array indexing is 0-based too - the index is that many offsets from the beginning from the array.

Re: Basics of Memory Addresses in C

#9
post #6

The fastest way to grok memory issues is to do some work in Assembly. Few programmers will use Assembly for regular work, but the intuition it fosters will serve you everywhere.

Absolutely.

First, learn assembly. Pick a machine architecture — it's not that important. For extra credit, pick multiple machine architectures and do something in each.

Then learn Lisp.

Re: Basics of Memory Addresses in C

#10
post #9
post #6

The fastest way to grok memory issues is to do some work in Assembly. Few programmers will use Assembly for regular work, but the intuition it fosters will serve you everywhere.

Absolutely. First, learn assembly. Pick a machine architecture — it's not that important. For extra credit, pick multiple machine architectures and do something in each. Then learn Lisp.

Then learn Forth.

And Morse code.

You'll need Haskell for dat Damas-Milner sexiness.

Wait wait, we need to pile on some Ruby and JavaScript, you don't want to be some sort of weirdo that can't make a web app do you?

Hrrrrm. Yep, need some APL. With Unicode.

That'll really hammer in the concatenative into your brain.

Post reply on HN