Garmaine Staff asked 2 years ago
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 7 hours ago.

It is giving me following error: error: no matching function for call to 'delete_response'

Can someone tell me why I am getting this error. I have implemented following method in my .cpp file:

void delete_response(string responses[], string categories[], int &size)
{
    int index=-1;
    string res;
    cout<<"Enter the response you want to delete"<<endl;
    cin>>res;
    for(int i=0;i<size;i++)
    {
        if(responses[i] == res)
        {
            index=i;
            break;
        }
    }
    if(index==-1)
    {
        cout<<"Not found"<<endl;
        return;
    }
    for(int j=index;j<size-1;j++)
    {
        responses[j]=responses[j+1];
        categories[j]=categories[j+1];
    }
    size=size-1;
}