请问vc++6.0中的stl库怎么样?

bucherren 2002-12-18 08:52:32
我想尝试一下,好像不怎么好用,运行起来有些异常。那个basic_filebuf的seekpos怎么用,我看它的原型是seekpos(pos_type pos,...)而pos_type是一个struct,里面只包含静态成员函数,没有数据成员,好像无从下手。
应该怎样,请指教。
我用的stl版本是1994年的,好像老了些。
...全文
115 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
陈硕 2002-12-19
  • 打赏
  • 举报
回复
上面这个例子并不能说明global object w没有destruct,也许因为global的std::cout先于w destruct,当w destructing时,std::cout已经不能发挥作用。
建议用printf()来测试。
GZCompiler 2002-12-19
  • 打赏
  • 举报
回复
mark
cwsheng 2002-12-19
  • 打赏
  • 举报
回复
VC带的STL有点变味。可以到候捷的网站上看看,http://www.jjhou.com/qa-cpp-primer-27.txt ,有个对比。
cnwwp 2002-12-19
  • 打赏
  • 举报
回复
在VC中使用STL与gcc下不同,可移植性大打折扣!
chinajiji 2002-12-19
  • 打赏
  • 举报
回复
这样做保你看到deconstructor在工作!
#include <iostream>
using namespace std;
class world
{
public:
world(){std::cout<<"Hello";}
~world(){std::cout<<"Bye";}
};

main(){
{
world w;
cout << "Leaving local field:" << endl;
}
};
或者这样:
include <iostream>
include <fstream>
using namespace std;
ofstream outfile("result.txt");
class world
{
public:
world(){outfile<<"Hello";}
~world(){outfile<<"Bye";}
};

world w;
main(){};
让"Hello Bye"输出到文件result.txt中,让你运行后打开这个文件慢慢看
asvaboy1980 2002-12-19
  • 打赏
  • 举报
回复
用stlport
binbin 2002-12-18
  • 打赏
  • 举报
回复
#include <iostream>

class world
{
public:
world(){std::cout<<"Hello";}
~world(){std::cout<<"Bye";}
};

world w;
main(){};

此例来自<<C++实践之路>>,在VC6中只显示Hello,不显示Bye.即全局对象w的析构函数没有运行到!
Thor_Cascades 2002-12-18
  • 打赏
  • 举报
回复
如果要用STL还是换BCB或是DEV-C++吧……
不过VC.NET也算可以
binbin 2002-12-18
  • 打赏
  • 举报
回复
从一些杂志上的文章看,VC的STL库不太行,对标准的实现不完全...

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧