0

Write a function that receives a letter then returns the next and previous letters. and this is my Solution

#include <iostream>
using namespace std;
void letter(char &x);
int main(){
    char a;
    cout<<"Enter your letter\n:";
    cin>>a;
    cout<<letter(a)<<endl;
    system("pause");
    return 0;}
void letter(char &x){
    cout<<x+1<<"  "<<x-1<<endl;
}

while trying to match the argument list '(std::ostream, void)' what is that mean ?

1 Answers1

0
cout<<letter(a)<<endl;

that have no sense, it's the same that

cout<< void << endl;

becouse your "letter(a)" function return nothing. maybe what you want to change it for:

#include <iostream>
using namespace std;
void letter(char &x);
int main(){
    char a;
    cout<<"Enter your letter\n:";
    cin>>a;
    letter(a);
    system("pause");
    return 0;
}
void letter(char &x){
    cout<<x+1<<"  "<<x-1<<endl;
}
lcjury
  • 1,158
  • 1
  • 14
  • 26