compare vectors for equality

Discussion in 'C' started by heidik, Jan 17, 2011.

  1. heidik

    heidik New Member

    Joined:
    Oct 23, 2010
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    0
    Hello all

    Could anyone please help?

    I have got two structs.

    Code:
    struct TRS_block
    {
        std::string trsLineID;
        
        std::string id1;
        std::string id2;
        
        std::vector<std::string> raw_contents;
    };
        
    struct LC_block
    {
        std::string lcLineID;
        
        std::vector<std::string> LC0413_IDs;
        std::vector<std::string> LC0419_IDs;
        
        std::vector<std::string> raw_contents;
    };
    
    Data in both structs has been stored in vectors. Both structs also contain vectors inside it. I want to match each element of the vector LC0413_IDs (of struct LC_block) with id1 and id2 (of struct TRS_block) for equality. If any of the elements of vector LC0413_IDs matches either of the two ids i-e id1 and id2, then e-g a flag would be set to true.

    Could anyone please help, how do I go about it.

    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice