Hey guys. I'm trying to create a program which adds, searches & removes items from an array & i've been messing around with the code, trying to find answers on the internet but so far no dice. Could any of you help out?
void removeString(List& s, string strKey, const int iARRAYSIZE, int result)
{
cout << "Enter the string to be deleted" << endl << ":" ;
cin >> strKey;
cout << endl ;
for (result = 0; result < iARRAYSIZE; result++ )
{
if ( s.strList[result] == strKey )
{
for (int i = s.iListIndex; i < s.iListLength ; i++)
{
s.strList[s.iListIndex] = s.strList[s.iListIndex+1];
s.strList[s.iListLength-1] = 0; //more than one operator
} //matches these operands
cout << "Succesfully Deleted" << endl;
}
else
{
cout << "Error 404" << endl;
}
}
}
This is what i have so far. I know it's crap but that's why i need help! Thanks :D