Vector of Structures

前端 未结 6 433
悲哀的现实
悲哀的现实 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:17

    void staticdata() {
        Pair temp[] =
        {
            {"string","string2",true}, 
            {"string","string3",true}, 
            {"string","string4",false}, 
            {"string","string7",false}, 
            {"string3","string8",false}
        };
    
        PairID.assign(temp,temp+5);
    }
    

提交回复
热议问题