Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   compare vectors for equality (http://www.go4expert.com/forums/compare-vectors-equality-t24581/)

heidik 17Jan2011 18:07

compare vectors for equality
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.


All times are GMT +5.5. The time now is 08:46.