Please Help?

So I am trying get some website names and putting them into a queue. So I got this far..I am trying to input these names and then check if they are valid website names and then display the valid ones only and delete the non-valid ones and then I need put them in a queue and if new names come in delete the 1st one and still keep it 10.


I cant figure this out..
#include <string>
#include <regex>
#include <iostream>
using namespace std;

bool IsValidURL(string urlString)
{
regex url(".*\\..*");
if (std::regex_match(urlString, url))
{
return true;
}
else
{
cout <<" wrong URL"<< urlString<< endl;
return false;
}
}
bool getURL ( string url[], int & position, bool IsValidURL() )
{
cout << "URL: ";

cin >> url[position];
++position;
if ( std::cin ) return true;
return false;
}
void displayURL ( string url[], int position )
{
int i = position;
cout << url[i--] << ' ';
while ( i != position )
{
cout << url[i] << ' ';
if ( i == 0 ) i = 9;
else --i;
}

cout << '\n';
}

int main()
{
string lastTenURL[10];
int position = 0;
do {
getURL ( lastTenURL, position );
}
while ( position < 10 );
--position;
displayURL ( lastTenURL, position );

string url = "Hello World";
bool result=IsValidURL(url);
cout <<url<<": "<<result << endl;

url = "www.google.com";
result = IsValidURL(url);
cout << url << ": " << result << endl;

string temp;
cin >> temp;

return 0;
}

Topic archived. No new replies allowed.