请问STL 中的vector的用法 我在定义 vector<int> temp; 时编译出错我已经包含了<vector>

解决方案 »

  1.   

    在#include <vector> 后面加上
    using namespace std;
    或者定义时写成 std::vector<int> temp;
      

  2.   

    来晚了,同意wtzyb4446(不死鸟)
      

  3.   

    To:wtzyb4446,johnxie132
        我是在一个类里定义的比如
    class CMy11Dlg : public CDialog
    {
    public:
    CMy11Dlg(CWnd* pParent = NULL); // standard constructor
             std::vector<int> tempint;报错,不知为什么
      

  4.   

    #include<vector>
    ..
    class CMy11Dlg : public CDialog
    {
    public:
    CMy11Dlg(CWnd* pParent = NULL); // standard constructor
             std::vector<int> tempint;
             .....
      

  5.   

    To :各位
         还是不行啊
     提示:
        error C2143: syntax error : missing ';' before '<' 
        error C2501: 'vector' : missing storage-class or type specifiers
        error C2059: syntax error : '<'
       错误
      

  6.   

    To: FAICHEN(CC)
       我想你那样写也会报错
      

  7.   

    谢谢各位的帮助,问题解决了,把include<vector> 放到CMy11Dlg.h中就没问题了,