#include
#include
using namespace std;
int main()
{
char c;
int i = 0;
char targetUrl[] = "http://definitions.symantec.com/defs/";
char url[100];
ifstream inStream("sep");
while (!inStream.eof())
{
inStream.get(c);
while ((i != 37) && (c == targetUrl[i]))
{
url[i] = c;
i++;
inStream.get(c);
}
if (i != 37) //url not found
{
url[0] = '\0';
i = 0;
}
else
{
while (c != '\"')
{
url[i++] = c;
inStream.get(c);
}
url[i] = '\0';
inStream.close();
ofstream outStream("sep");
outStream << url;
outStream.close();
return 0;
}
}
return 0;
}
No comments:
Post a Comment