I would like to know where in memory the global variables are stored. Thanks for your help.

  • 2
    $\begingroup$ Dude, this was the FIRST goddamn link on google: stackoverflow.com/questions/14588767/… Did you even try that one? $\endgroup$ – Syed Ali Hamza Dec 13 '16 at 11:45
  • 1
    $\begingroup$ Also, here is...a result from the 4th result. geeksforgeeks.org/memory-layout-of-c-program Is that what you wanted to know? $\endgroup$ – Syed Ali Hamza Dec 13 '16 at 11:46
  • 3
    $\begingroup$ @SyedAliHamza While you're right to point out that this question is trivially answerable using standard resources, there's absolutely no need to be rude about it. Please be nice. $\endgroup$ – David Richerby Dec 13 '16 at 12:20
  • $\begingroup$ @DavidRicherby, "maybe" I was being rude. Probably subconsciously. I'll keep that in mid. $\endgroup$ – Syed Ali Hamza Dec 13 '16 at 12:27
  • $\begingroup$ @SyedAliHamza When you start using shoutycaps and curse words, that's pretty much the definition of rude. I'm glad it wasn't intentional, but please do keep it in mind. $\endgroup$ – David Richerby Dec 13 '16 at 12:43

This really just depends on the compiler you're using and the architecture you're targeting. For instance, I could make a compiler which assigns global variables to general purpose registers in bank 2 of a PIC16f887a microcontroller. It's arbitrary. This is a bad question.

| cite | improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.