I have to write a code for delaying subtitles.
I have to open .srt file change all the time for some time and save it in another file. I know how to open file and copy all to other file.
For example if i open "Subtitle.srt" and then write the name of output file "output" i would get the copied content of "Subtitle.srt" to "outputSubtitle.srt".
This is ok but I dont know how to delay time for instance if I input "10"
Original Subbtitle.srt 00:00:01,067 --> 00:00:03,963 and then I enter 10 outputSubtitle.srt 00:00:11,067 --> 00:00:13,963
I have to change all the times.
#include "stdafx.h"
#include "iostream"
#include "cstdlib"
#include "fstream"
#include "string"
using namespace std;
int main(int argc, char *argv[]){
ifstream input; //input
char input_file[32]; //names of input and output
cout << "Enter name of input fille: "; ///user gives names of input
cin >> input_file;
input.open(input_file);
if (!input.good()){
cout << "File " << input_file << " dosen't exist." << endl;
return 1;
}
string row;
while (!input.eof()){
getline(input, row);
cout << row << endl;
}
system("pause");
return 0;
}