Here's my code. I get lot's of errors from the compiler. Can you simply fix explicit errors that I made? So that I am on the right track and then I can keep fixing.
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
// make sure the user provided two arguments only
if (argc != 2)
{
printf("Provide only two arguments");
return 1;
} else
{
// prompts the user to enter plaintext
printf("plaintext:");
string input = get_string();
// keep the length or argv in l
int l = strlen(*argv);
// convert user-provided argument to lowercase
for (int i = 0; i < l; i++)
{
tolower(argv[i]);
}
// make sure the user-provided input does not equal to NULL
if (input != NULL)
{
// iterate through the user-provided input
for(int i = 0, int n = strlen(input); i < n; i++)
{
// do this only if i'th character in user-provided input is alphabetical
if (isalpha(input[i]))
{
// do this only for lowercase alphabetical characters of the user's input
if(islower(input[i]))
{
// do this to lower-case letters
printf("%c", ( (input[i] - 97) + (key[(l + i ) % l] - 97 )) % 26 + 97);
} else
{
// do this to upper-case letters
printf("%c", ( (input[i] - 65) + (key[(l + i ) % l] - 65 )) % 26 + 65);
}
} else
{
// do this only for non-alphabetical characters of the user's input
printf("%c", input[i]);
}
}
printf("\n");
}
}
}