1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

compare vectors for equality

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

  1. heidik

    heidik New Member

    Oct 23, 2010
    Likes Received:
    Trophy Points:
    Hello all

    Could anyone please help?

    I have got two structs.

    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.


Share This Page