jeudi 11 mars 2021

Can't return char in c++

Here is my code:

char pattern(int x){
  if (x < 13){
    return "a";
  }
  if (x < 26){
    return "b";
  }
}

The error is invalid conversion from 'const char*' to 'int' I tried searching for the error online but all the resources are only for C. Please advice.

Aucun commentaire:

Enregistrer un commentaire