My code isn't compiling. I'm getting "undefined reference to 'get_string'" I think there is an issue with the way i have contextualized the first part of my code, i.e., above the "for" loop. I'm not sure how to proceed.
#include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
//
int main(int argc, string argv[])
{
while (argc == 2)
argv[1] = "3";
int k = atoi(argv[1]);
char c;
string p = get_string("Plaintext: ");
for (int i = 0, n = strlen(p); i < n; i++)
{
// Checks for letters and uppercase
if (isalpha(p[i]) && isupper(p[i]))
{
// If uppercase, print as uppercase
printf( "%c", (p[i]));
}
// if not uppercase
else if (isalpha(p[i]) && islower(p[i]))
{
// print lowercase
printf("%c", (p[i]));
}
// If charecter is not a letter
else
{
// Print non-letter character
printf("%c,", p[i]);
}
// Moves plaintext characters to ciphertext
c = (p[i] + k) % 26;
printf("ciphertext: %c", c);
printf("\n");
}
}