My c++ code looks like:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream fin("input.txt");
ofstream fout("out.txt");
string line;
unsigned int number=0;
int counter=0;
while(fin>>line)
{
while(counter<=2)
{
if(line[number]=='/')
counter++;
number++;
}
for(int i=0;i<number;i++)
{
fout.put(line[i]);
}
fout.put('\n');
number=0;
counter=0;
cin.clear();
}
cout<<"DONE!";
}
when i try to run it the program stops working, what might cause this problem? There is no infinit loop, because there is lot of '/' symbols in input.txt. The Program outputs file, this file does not contain whole information but only part of result...
If any information is needet to solve this problem, will be happy to share it.
SAMPLE of input.txt :
http://www.ttsgs.com/page/51/
http://meshing.it/companies/61855-Granify
http://www.theglobeandmail.com/report-on-business/small.....
https://venngage.com/blog/index.php/page/5/
http://www.klasscapital.com/portfolio/granify
http://content.granify.com/why-ab-testing-is-not-enough
http://meetups.shopify.com/meetups/edmonton-shopify-meet-up
http://www.klasscapital.com/partners/jeff-lawrence
https://medium.com/startup-communities/81bb8f8ddfcb
http://freshit.net/blog/internet-marketing/chyortova-dy.....
http://www.higeek.cn/granify?????????.....
http://savepearlharbor.com/?paged=2557
http://www.sellerforum.de/small-talk-allgemeines-f1/irc.....
https://trango.co/preventing-abandoned-carts-using-ai/
http://www.imdevice.com/204602/
http://www.ifanr.com/news/page/17
http://www.webdesign-inspiration.com/web-designs/style/.....
http://worthyofnote.co.uk/tag/ecommerce/page/3/
http://www.siliconsolutions-inc.com/granify-raises-1-5-.....
http://crowdfundingnews.com/category/tech/page/425/
http://meetups.shopify.com/meetups/30
SAMPLE of out.txt:
http://www.ttsgs.com/
http://meshing.it/
http://www.theglobeandmail.com/
https://venngage.com/
http://www.klasscapital.com/
http://content.granify.com/
http://meetups.shopify.com/
http://www.klasscapital.com/
https://medium.com/
http://freshit.net/
http://www.higeek.cn/
http://savepearlharbor.com/
http://www.sellerforum.de/
https://trango.co/
http://www.imdevice.com/
http://www.ifanr.com/
http://www.webdesign-inspiration.com/
http://worthyofnote.co.uk/
http://www.siliconsolutions-inc.com/
http://crowdfundingnews.com/
http://meetups.shopify.com/
https://angel.co/
http://cdling.com/
http://www.sunwei.asia/
https://angel.co/