【发布时间】:2011-12-20 18:09:34
【问题描述】:
它是如何工作的?变量是存储在特殊寄存器还是内存中?我在视觉中查看寄存器/内存窗口,但我无法理解:(
#include <iostream>
using namespace std;
namespace first
{
int x = 5;
int y = 10;
}
namespace second
{
double x = 3.1416;
double y = 2.7183;
}
int main () {
using first::x;
using second::y;
cout << x << endl;
cout << y << endl;
cout << first::y << endl;
cout << second::x << endl;
return 0;
}
class CRectangle {
int x, y;
public:
void set_values (int,int);
int area (void);
private:
int param;
} rect;
【问题讨论】:
-
尝试搜索“name mangling”
标签: c++ assembly namespaces