Compiler is complaining about incompatible variable types stored in array. This happens, when I'm trying to convert characters from argv[1] to uppercase (first for loop). Similar error occurs in second for loop, where I'd like to convert chars to their ASCII equivalent and subtract 64 from it. What do?
//converts chars in argv[1] to uppercase letters
for (int i = 0, n = strlen(argv[1]); i < n; i++){
argv[i] = toupper(argv[i]);
}
//converts chars in argv[1] to numbers
int key[strlen(argv[1])];
for (int i = 0, n = strlen(argv[1]); i<n; i++){
key[i]= argv[i]-64;
Error mesagges:
incompatible integer to pointer conversion assigning to 'string' (aka 'char *') from 'int' [-Werror,-Wint-conversion]
and
incompatible pointer to integer conversion assigning to 'int' from 'string' (aka 'char *') [-Werror,-Wint-conversion]