一个图可以说明很多问题
#include <iostream> int a=0; int func(){return 1;} int _tmain(int argc, _TCHAR* argv[]) { int i=10; int j=11; std::cout<<&a<<std::endl;//数据区 std::cout<<func<<std::endl;//代码区 std::cout<<&argc<<std::endl;//栈 std::cout<<&i<<std::endl; std::cout<<&j<<std::endl; int* pe=new int; int* pf=new int; std::cout<<pe<<std::endl;//堆 std::cout<<pf<<std::endl; if (i<10) { i++; } for (i=0;i<10;i++) { double x=0; } return 0; }