I've read other questions about this error but non helped. I've tried everything people suggest but i can't get rid of this error: "invalid conversion from 'const char*' to 'char'". This is a simple program to encrypt a given char using Caesar's encryption method.
#include <iostream>
using namespace std;
char encryptChar(char c, int key) {
int final;
if (int(c) > 90){
final = (int(c) + key - 97)%26 + 97;
}
else {
final = (int(c) + key - 65)%26 + 65;
}
cout << char(final);
return char(final);
}
int main(){
char test = "B";
encryptChar(test,2);
return 0;
}