I'm trying to take a char and add it to a string. OR if that's not possible, add it to an array of characters?
I tried changed 'string updated = ""' to 'char updated[text_length]' but I was getting the same error - incompatible integer to pointer conversion error
if(argc == 2 && IsDigitsOnly(argv[argc-1])) {
// convert to integer
int x = atoi(argv[argc-1]);
// prompt user for plaintext
string plaintext = get_string("plaintext: ");
int text_length = strlen(plaintext);
int ascii = 'a';
string updated= "";
for (int i = 0; i < text_length; i++)
{
if (isalpha(plaintext[i]))
{
if (isupper(plaintext[i]))
{
// GETTING ERROR HERE -- trying to pass 'letter' in strcat
// This gives me an error: incompatible integer to pointer conversion error
int n = (plaintext[i] + x) % 90;
char letter = n;
strcat(updated, letter);
}
else
{
ascii = (ascii + x) % 122;
}
}
}
printf("%s\n", updated);
}