The function should return true if the string only contains hexadecimal chars. However it keeps returning true not matter what the input is,
Code:inline bool hex(string String, int Lenght) { // Integer that will have a value of 1 if a number is found. int FoundHex = 1; // The set of special characters string Hex = "abcdefABCDEF012345689"; // When the counter is less or equals to the lenght of the string and no special character has been found go to the next string index. for(int counter = 0; counter <= Lenght && FoundHex != 1; counter++) { // Integer to hold the lenght of the string containing our specials. int HexSize = Hex.size(); // Loop through all our special characters. for( int Scounter = 0; Scounter < HexSize; Scounter++) { // When the current special character does not matches the location we are pointing to of our string set FoundSpecial to 0. if(String[counter] != Hex[Scounter]) { FoundHex = 0; } } } // Return result. if(FoundHex == 1) { return true; } else { return false; } }