merged from master and relocate headers inside srcs

This commit is contained in:
hugogogo
2022-08-01 20:33:06 +02:00
21 changed files with 552 additions and 374 deletions

View File

@@ -29,3 +29,26 @@ std::string itos(int n)
return ( strs.str() );
}
bool isNumeric(std::string str)
{
for (size_t i = 0; i < str.length(); i++)
{
if (std::isdigit(str[i]) == false)
return false;
}
return true;
}
bool isNumeric_btw(int low, int high, std::string str)
{
for (size_t i = 0; i < str.length(); i++)
{
if (std::isdigit(str[i]) == false)
return false;
}
int n = std::atoi(str.c_str());
if (n < low || n > high)
return false;
return true;
}