79482069

Date: 2025-03-03 20:32:25
Score: 1
Natty:
Report link

The logical operator || is only used to verify whether multiple conditions will obtain a true or false value. It's not used for finding items in a string. Instead use else if-statements:

if (str.find("Legs") != std::string::npos) {
    ...
}
else if (str.find("Arms") != std::string::npos) {
    ...
}
.
.
.
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Quatumiser 101