Ich schreibe ein schnelles Programm, um mich wieder mit C++ vertraut zu machen, aber ich bekomme den Titelfehler auf meinem Schalter (Wahl) { Fall "A": Pause;} Linie.Wert des Typs 'const char [2]' ist nicht implizit in 'int' umwandelbar ERROR C++
[Wert des Typs ‚const char [2]‘ ist nicht implizit konvertierbar ‚int‘]
Wenn jemand könnte mir helfen, zu verstehen, warum ich diesen Fehler und wie es zu beheben, würde sehr geschätzt werden. Vielen Dank!
Bild von Fehler: http://imgur.com/a/d2A0P
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
char printMenuChoice(char choice);
void printSpace(){
cout << endl;
}
int main(){
//Print Menu Choice
char choice;
choice = printMenuChoice(choice);
cout << "Choice is " << choice << endl;
switch(choice){
case "A":
break;
}
//Attack
//Chop
//Shop
//Stats
//Exit
}
char printMenuChoice(char choice){
cout << "[]--- Welcome to Quick Quests ---[]" << endl;
printSpace();
cout << "Attack <A>" << endl;
cout << "Chop <B>" << endl;
cout << "Shop <C>" << endl;
cout << "Exit <E>" << endl;
printSpace();
cout << "Input Your Choice: ";
printSpace();
cin >> choice;
choice = toupper(choice);
return choice;
}
Danke! Ich arbeitete nebenbei in der GML-Sprache und dachte, es wäre eine andere Art, als // und/* */zu kommentieren. –