3. If you must use char pointer, then at least make them const. > void addMenu(const char* Description, void (*f)());
4. strcpy_s(this->mi[count].decript, Description);
It's only safe if you know how to use it.
> https://en.cppreference.com/w/c/string/byte/strcpy
strcpy_s has THREE parameters.
Did you really get no warning when you compiled this line?
Ok I tried to fix it but it still does not build
I get 'Menu::addMenu': function does not take 2 arguments
syntax error: identifier 'string'
missing type specifier - int assumed. C++ does not support default-int Menu.h-12
Variable Menu::mi is uninitialized menu.cpp line 8
Errors that I get when trying to build OP's project (after stripping out the Windows-specific stuff):
Buildtest/Menu.h:8:2: error: unknown type name 'string'; did you mean 'std::string'?
string descript;
^~~~~~
std::string
Buildtest/Menu.h:18:15: error: unknown type name 'string'; did you mean 'std::string'?
void addMenu(string Description, void(*f) ());
^~~~~~
std::string