d06 ex00 all checks are ok
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "color.h"
|
||||
|
||||
bool checkChar(std::string str);
|
||||
bool checkInt(std::string str);
|
||||
bool checkFloat(std::string str);
|
||||
bool checkDouble(std::string str);
|
||||
#include "convert.h"
|
||||
|
||||
bool isElse(std::string str) {
|
||||
std::cout << str << B_RED " is not valid type for this exercise" RESET "\n";
|
||||
std::cout << B_RED << str << CYAN " is not valid type for this exercise" RESET "\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -23,9 +18,11 @@ bool (*checkFunc[])(std::string str) =
|
||||
|
||||
void convert(std::string str) {
|
||||
|
||||
std::cout << B_BLUE << str << RESET "\n";
|
||||
int size = sizeof(checkFunc) / sizeof(checkFunc[0]);
|
||||
|
||||
for (int it = 0; it < size; it++)
|
||||
if ((*checkFunc[it])(str))
|
||||
break;
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user