Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- size_t CountValues(const char * data, size_t size) {
- size_t count = 0, total_length = 0;
- while (...) {
- size_t length = 0;
- for (size_t i = 0; i < 8; ++i) {
- data += i;
- length = pow(256, i) * (*(data));
- }
- for (size_t i = 0; i < length; ++i) {
- ++data;
- }
- total_length += length;
- ++count;
- }
- if (total_length < size)
- throw RangeError;
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement