vector<CString>&files, 为什么要加&,加&是什么意思?files.size是什么意思?

解决方案 »

  1.   

    加&表示指针files.size表示容器的元素大小
      

  2.   

    files.size是什么意思?
    ----------------------------
    vector::sizepublic member functionsize_type size() const;
    Return sizeReturns the number of elements in the vector container.This is the number of actual objects held in the vector, which is not necessarily equal to its storage capacity. Vectors automatically reallocate their storage space when needed or when requested with member resize. To retrieve the current storage capacity of a vector you can call to its member capacity.
      

  3.   

    这种定义常在函数的参数中定义,表示引用;这样当函数返回时,vector变量files的值与在函数中对这个变量进行的任何操作后的值一致。也就是说,该变量的值允许在函数中进行修改。