Why do books say, "the compiler allocates space for variables in memory"?
<p>Why do books say,  "the compiler allocates space  for variables in memory". Isn't it the executable which does that? I mean, for example, if I write the following program,</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
   int foo;
   return 0;
}
</code></pre>

<p>and compile it, and get an executable (let it be program.exe), now, if I run program.exe, this executable file will itself command to allocate some space for the variable foo. Won't  it ? Please explain why books keep on saying, "the compiler will do this...do that".</p>
