stl书上的例子: 编译通不过,出现如下错误: yxb@yxb-desktop:~/stl/stl$ g++ ioiter1.cpp -o exe ioiter1.cpp: In function ‘int main()’: ioiter1.cpp:14: 错误: ‘istream_iterator’在此作用域中尚未声明 ioiter1.cpp:14: 错误: expected primary-expression before ‘>’ token ioiter1.cpp:15: 错误: expected primary-expression before ‘>’ token ioiter1.cpp:15: 错误: expected primary-expression before ‘...
by sharpshootor - C/C++ - 2008-12-23 16:10:32 阅读(3134) 回复(3)
编译有问题的代码:
[code]
#include
[code] class doctmpl { ............... //声明 protected: char varflag; istream& is; ifstream ifs; ............... }; //这个函数正确 inline doctmpl::doctmpl(const string& fname, char chvar /* = '$' */) : ifs(fname.c_str()), is(ifs), varflag(chvar) { if ( !ifs.is_open() ) throw e_stream_err; } //open函数通不过 inline void doctmpl::open(const string& fname, char chvar) { ifs.open(fname.c_s...
如题 补充一下,像gdi+的话,有一样很方便的功能,如: 1. 对各种图像格式的支持,如bmp,jpg,tiff,... 2. 支持对各种图像的处理,如旋转缩放... 3. 支持常用的图形学算法,如用矩阵变换 4. 可以和操作系统结合,进行显示 [ 本帖最后由 jronald 于 2008-9-11 23:40 编辑 ]
不明白为什么会有这个编译错误,想了半天没想出来,大家给支支招
[code]
#include
#include
std::istringstream iss("1 2 3 4");
std::istream_iterator
1. 我用的是RedHat 9.0
2. gcc 是 3.2.2
3. 代码如下:
#include