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;
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 );