Is this the same kind of ASCII file you were reading in the last post you made about this kind of thing?In my file I have 48 rows
If it is, why are you using these bitset structures to hold the values after you have parsed the lines? I think you are seriously confused about the range of values that the numbers in your file can have and how to represent them in your code.
If you are reading an ASCII number from the file where that number can have a range of 0 - 4096, there is no need to represent it in your code as bitset<12>. A normal C++ unsigned 16-bit integer is adequate. A value with a 24-bit range (0 - 16777215) can be held in a 32-bit unsigned integer.
You have your choice of everything from unsigned char to unsigned long long, and you can do any sort of standard arithmetic processing with them, something you can't do with bitset.
So for your original question:My need is to find the missing frame_counter values when processing the corresponding file line
1) Create an "expectedFrameCounter" variable outside the loop and initialize it to zero.
2) Have your processLine() method return the frame_counter value it reads from the line
3) Compare it to "expectedFrameCounter".
4) If they match, no problem
5) If they don't match, then add "expectedFrameCounter" to a list of "missing frames"
(If more than one frame can be skipped, then add all of the values from "expectedFrameCounter" to the value returned by processLine() - 1).
6) Set "expectedFrameCounter" to the value returned by processLine + 1 and continue.
Bookmarks