Hi so I am given a time i.e. 05:10:12 and storing that into a string but I need help converting the hours part (05) into an int then minutes part (10) into an int then seconds part (12) into an int so I can preform other equations. Please help.

```
#include <iostream>
#include <cmath>
#include <cctype>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;

const int max = 50; //max transactions possible                                                                     

void get(string&, string&, ifstream&);
void format(string&);
void average();
void deviation();
void median();
void print(string, ofstream&, string, string);

int main()
{
  ifstream inf;
  ofstream outf;
  string filename, name, stime, etime;
  int hour, min, sec, totalsec;
  double average, sd, median;

  cout << "Please enter name of input file:" << endl;
  cin >> filename;

  inf.open(filename.c_str());
  outf.open("kigerprog05out");

  outf << "Morgan Kiger LecSec1002 LabSec1005 Assignment 05" << endl << endl;
  outf << "NAME" << right << setw(20) << "START TIME" << setw(15) << "END TIME" << setw(15) << "TOTAL SECS" << endl;

  inf >> name;

  while(inf)
    {
      get(stime, etime, inf);
      format(name);
      print(name, outf, stime, etime);

      inf >> name;
    }
  inf.close();
  outf.close();

  return 0;
}

void get(string& stime, string& etime, ifstream& inf)
{
  inf >> stime;
  inf >> etime;

  return;
}

void format(string& name)
{
  int wlen = name.length();
  name[0] = toupper(name[0]);
  for(int i=1; i<wlen; i++)
    {
      name[i] = tolower(name[i]);
    }

  return;

}

void print(string name, ofstream& outf, string stime, string etime)
{
  outf << left << name << right << setw(18) << stime << setw(15) << etime << setw(15) << endl;

  return;
}

```