Possible Duplicate:
What and where are the stack and heap?
A vary basic question, please forgive my ignorance. Please let me know whether a simple variable declaration in C++ for an ordinary (automatic non-static and non-global) variable for example.... float x; within the scope of a function, say main() uses stack or heap (free store) memory? I am asking this because code such as the one given below works in C++, but not in C. Thanks in advance.
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if(a < b)
{
int c = 1925;
float d = 0.7;
}
else
{
double e = 889.7;
short f = 35;
}
return 0;
}