So I got file that look like:

```
$GPGGA,124613.90,5543.3221231,N,03739.1368442,E,1,15,0.69,147.0851,M,14.4298,M,,*54
$GPGSV,3,1,10,27,12,078,41,05,31,308,49,16,25,043,44,02,11,268,44*7E
$GPGSV,3,2,10,26,03,031,39,07,74,216,52,09,58,121,52,30,39,234,48*71
$GPGSV,3,3,10,23,30,116,46,04,37,114,47*79
$GLGSV,2,1,07,84,17,338,43,78,15,212,48,85,12,032,46,67,84,223,53*67
$GLGSV,2,2,07,77,67,195,47,76,50,047,54,66,32,144,52*5C
$GPGGA,124614.00,5543.3221239,N,03739.1368445,E,1,15,0.69,147.0864,M,14.4298,M,,*53
$GPGSV,3,1,10,27,12,078,41,05,31,308,49,16,25,043,43,02,11,268,44*79
$GPGSV,3,2,10,26,03,031,39,07,74,216,52,09,58,121,52,30,39,234,48*71
$GPGSV,3,3,10,23,30,116,46,04,37,114,47*79
$GLGSV,2,1,07,84,17,338,43,78,15,212,48,85,12,032,46,67,84,223,53*67
$GLGSV,2,2,07,77,67,195,47,76,50,047,54,66,32,144,52*5C

```

My cod is checking check sum of string and output some values in strings.
In $GPGGA line "124614.00" is time. 12 hours 46 minutes 14.00 sec. I need to output time of "appearance" $GPGSV lines. I`ve tried subtract first value and the following ones through the pointer, but I must have messed up somewhere.

```
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <stdio.h>

int checksum(const char* s) {
  int c = 0;

  while (*s)
    c ^= *s++;

  return c;
}

int main() {
  char linec_h[200];
  int k, key;
  int* hour = NULL;
  int* minute = NULL;
  float* sec = NULL;
  std::string line, key_s;

  std::ifstream logs_("C:/Users/Olya/Desktop/broken.txt");
  std::ofstream pout("C:/Users/Olya/Desktop/outLOG.txt");

  if (logs_.is_open()) {
    while (getline(logs_, line)) {
      key_s = line.substr(line.length() - 2, 2);
      key = strtol(key_s.c_str(), NULL, 16);

      line = line.substr(1, line.length() - 4);
      strcpy_s(linec_h, line.c_str());
      if (key != checksum(linec_h))
        pout << "Line is corrupted!" << std::endl;
      else {
        k = 0;
        if (line.substr(0, 5) == "GPGGA") {
          if (hour, minute, sec) {
            *hour = stoi(line.substr(5, 2)) - *hour;
            *minute = stoi(line.substr(7, 2)) - *minute;
            *sec = stof(line.substr(9, 4)) - *sec;
          }

          else {
            hour = new int;
            minute = new int;
            sec = new float;
            *hour = stoi(line.substr(5, 2));
            *minute = stoi(line.substr(7, 2));
            *sec = stof(line.substr(9, 4));
          }

        } else if (line.substr(0, 5) == "GPGSV") {
          for (size_t i = 0, SNR = 7, N = 4; i < line.size(); i++) {
            if (line[i] == ',')
              k++;
            if (k == N) {
              pout << "Satellite number -- " << line.substr(i + 1, 2) << "  ";
              if ((N += 4) > 16)
                ;
            } else if (k == SNR) {
              pout << "SNR -- " << line.substr(i + 1, 2) << "  time -- " << hour
                   << "." << minute << "." << sec << std::endl;
              if ((SNR += 4) > 19)
                break;
            }
          }
        }
      }
      delete hour;
      delete minute;
      delete sec;
    }
    logs_.close();
    std::cout << "Success" << std::endl;
  } else
    std::cout << "File is not open" << '\n';
  pout.close();

  return 0;
}

```