Vector of Structures

前端 未结 6 465
悲哀的现实
悲哀的现实 2021-01-18 11:42

I have some code given to me by another person in which we have a structure

struct Pair {
    string s1;
    string s2;
    bool equivalent;
  };
         


        
6条回答
  •  轮回少年
    2021-01-18 12:29

    struct Pair 
    {
       string s1;
       string s2;
       bool equivalent;
    };
    std::vector PairID;         
    
    Pair pair;
    
    pair.s1 = "abc";
    pair.s2 = "abc";
    pair.equivalent = TRUE;
    
    PairID.push_back(pair);
    

提交回复
热议问题