I have the following code:
std::vector<std::string> GetSameID(std::vector<string>& allFiles, int id) { std::vector<std::string> returnVector; for(std::vector<string>::iterator it = allFiles.begin(); it != allFiles.end(); ++it) { if(GetID(*it) == id) { int index = (*it).find("_CH2.raw"); if(index > 0) { continue;
My problem is why if(0 < ((*it).find("_CH2.raw")))
doesnβt work like that? My files are called ID_0_X_0_Y_128_CH1.raw ID_0_X_0_Y_128_CH2.raw (different identifiers, X and Y, for channel 1 and channel 2 on the oscilloscope).
When I do this to the end (assign an index and then check the index), it works, I donβt understand why the short version, which is more readable, does not work.
source share