0

It keeps bringing up that error and I can't understand how it's happening and what's the fix here's the code with an error when calling the function crypt in main ///////////basic libraries

void cyrpt(string s, int k);

int main(int argc, string argv[])
{

    int k = 0;
    string s = get_string("plaintext: ");  
    crypt(s,k);

}
//crypts the string in terms of given k and the string itself and returns the ciphertext

void cyrpt(string f, int k)
{

    for (int i = 0, n = strlen(f) ;i < n ;i++)
    {
        f[i] = f[i] + k;
    }
        printf ("%s\n",f);

}
1

Look carefully at the following two statements:

void cyrpt(string s, int k);
.....

crypt(s,k);
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .