When I try to compile my code using this:g++ -Wall -std=c++11 -o test10 program10.cpp This occurs:
program10.cpp: In function 'int getInt(std::string)':
program10.cpp:76:1: warning: control reaches end of non-void function [-Wreturn-type]
Here is the code:
int getInt(string str) {
string bin[] = {"11000", "00011", "00101", "00110", "01001",
"01010", "01100", "10001", "10010", "10100"};
for (int i = 0; i < 10; i++) {
if (str.compare(bin[i]) == 0) {
return i;
}
}
}
Aucun commentaire:
Enregistrer un commentaire