论坛里C++的大佬们,帮小弟一个忙啊:
最近遇到一些关于vector的东西,但是我对这个是一窍不通的,能否提供一些资料或者电子书什么的!感谢啦!本人分数不多献上20!

解决方案 »

  1.   

    看这个吧
    http://wenku.baidu.com/view/27b967c66137ee06eff918b3.html
      

  2.   

    楼上那个不错,个人觉得vector就是容器,装东西的,里面已经定义了很多的操作供你享用,方便快捷。C++primer上写的很全
      

  3.   

    恩 大家说的 差不多了 我就提个建议 对于stl的东西多看多练多使用,熟能生巧,可以看看楼上说的primer plus 很不错还有其他容器的介绍,可以借机学习一下
      

  4.   

    http://www.cplusplus.com
      

  5.   

    建议你看看《C++ primer》。很详细。另外,网上搜一下,也有很多相关的东西
      

  6.   

    #include <iostream>
    #include <string>
    using namespace std;template<typename Object>
    class MemoryCell
    {
    public:
    explicit MemoryCell(const Object & initialValue = Object())
    : storedValue(initialValue) {} 
    const Object & Read() const
    {return storedValue;} void Write(const Object & x)
    {storedValue = x ;}private:
    Object storedValue ;
    };int main()
    {
    MemoryCell<int> m1 ;
    MemoryCell<string> m2 ;( "hello" ) ;
    m1.Write(34) ;
    m2.Write(m2.Read() + " world") ;
    cout<<m1.Read()<<endl ;
    cout<<m2.Read()<<endl ;
    return 0;
    }上面代码里面MemoryCell<string> m2 ;( "hello" ) ;是什么意思啊?
      

  7.   

    MemoryCell<string> m2 ;( "hello" ) ;
    多余的语句
      

  8.   

    MemoryCell<string> m2( "hello" ) ;
    要么是这样的
      

  9.   

    可能是印刷错误谢谢Eleven的帮助,同时感谢你的网站!