CODE
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void take_links(string filename)
{
const int MAX_LINKS = 20;
char* temp = "";
char* temp2 = "";
string links[MAX_LINKS]= { ""};
int i, j = 0;
ifstream in(filename.c_str());
ofstream out("test.html");
while(in.getline(temp,128) != NULL){
for(i = 0; i < 128; i++){
if((*(temp+i) == 22)&&(*(temp+(i+1)) != 22)){
if(*(temp+i)==23) break;
*(temp2+i) = *(temp+i);
}
}
links[j] = temp2;
//cout << links[j] <<< endl;
j++;
}
j = 0;
while(links[j]!="") j++;
for(int ctr = 0; ctr < j; ctr++) out << links[ctr] << endl;
}
int main()
{
string file_ = "FAIL.TXT";
take_links(file_);
cin.ignore();
return 0;
}
.
#include <fstream>
#include <string>
using namespace std;
void take_links(string filename)
{
const int MAX_LINKS = 20;
char* temp = "";
char* temp2 = "";
string links[MAX_LINKS]= { ""};
int i, j = 0;
ifstream in(filename.c_str());
ofstream out("test.html");
while(in.getline(temp,128) != NULL){
for(i = 0; i < 128; i++){
if((*(temp+i) == 22)&&(*(temp+(i+1)) != 22)){
if(*(temp+i)==23) break;
*(temp2+i) = *(temp+i);
}
}
links[j] = temp2;
//cout << links[j] <<< endl;
j++;
}
j = 0;
while(links[j]!="") j++;
for(int ctr = 0; ctr < j; ctr++) out << links[ctr] << endl;
}
int main()
{
string file_ = "FAIL.TXT";
take_links(file_);
cin.ignore();
return 0;
}
