|

楼主 |
发表于 2003-8-30 23:25:34
|
显示全部楼层
似乎是使用static struct
我写了如下的代码测试:
- #include<iostream>
- using namespace std;
-
- int
- main()
- {
- struct lconv * ptr = NULL;
- while (ptr = localeconv());
- cout << "heap was exhausted!" << endl;
- }
复制代码
然后我使用gdb调试,发现ptr的值一直没变,所以它不应该是在堆中动态分配的,而应该是在全局区中分配的。 |
|