Re: Global Variables : Where are they stored ?



On Nov 29, 4:13 pm, Keith Thompson <ks...@xxxxxxx> wrote:

I don't suggest that questions about memory segments aren't important,
or that you shouldn't be asking about them in interviews, just that
such questions aren't really about C.


I agree, and thanks for all the corrections on my posts with my
limited knowledge on the C standard.

Since we deal with mostly Windows (desktop + many variants of CE) and
Linux (many variants of desktop + many variants of embedded Linux),
and our code happens to be in C and C++, we are looking for people who
are at least familiar with the concept of memory layout as described
in the following.

http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php
http://blogs.msdn.com/sloh/archive/2005/02/25/380475.aspx


Since we also deal with many compilers, some of which do not comply
with "the standard", we are (at least I am) slacking quite a bit on
the correct definition of C :)

At the end of the day, the answer "implementation-specific" to OP is
wise and correct, but it will unlikely satisfy the interviewer. The
expected answer is to describe the "general" memory layout of a
process, given the simple, yet subtle question asked in C. And never
heard of "stack/heap" is sort of a no-no :)

Cheers!
.



Relevant Pages

  • Re: Global Variables : Where are they stored ?
    ... or that you shouldn't be asking about them in interviews, ... limited knowledge on the C standard. ... Linux, ... Very few compilers fully implement the C99 standard, ...
    (comp.lang.c)
  • Re: Linux point of view (for a report)
    ... > Hi I am doing a school report on linux, And I need to get some Web ... And Also some interviews that I can use that would be very ... Andrew Morten and Robert Love, ...
    (comp.os.linux.misc)
  • Re: Linux point of view (for a report)
    ... I need web sites that explain Linux, ... And Also some interviews that I can use that would be very ... This report will cover the people behind Linux, What it is, ...
    (comp.os.linux.misc)