23 lines
440 B
C++
23 lines
440 B
C++
#include <iostream>
|
|
#include <string>
|
|
#include "convert.h"
|
|
|
|
bool (*checkFunc[])(std::string str) =
|
|
{
|
|
checkChar,
|
|
checkInt,
|
|
checkFloat,
|
|
checkDouble,
|
|
};
|
|
|
|
void convert(std::string str) {
|
|
|
|
std::cout << "\n" B_BLUE << str << RESET "\n";
|
|
int size = sizeof(checkFunc) / sizeof(checkFunc[0]);
|
|
|
|
for (int it = 0; it < size; it++)
|
|
if ((*checkFunc[it])(str))
|
|
return ;
|
|
std::cout << B_RED "is not valid type for this exercise" RESET "\n";
|
|
}
|