I've got a function which looks like this:
bool generate_script (bool net, bool tv, bool phone, std::string clientsID, std::string password, int index, std::string number, std::string Iport, std::string sernoID, std::string VoiP_number, std::string VoiP_pass, std::string target, int slot, int port, int onu, int extra, std::string IP, std::string MAC);
In my opinion it looks ugly. What is the proper way of handling this problem? Should I create few vectors with different data types (int, string and bool) and pass them as arguments to this function?
Note that when you are working with multiple parameters, the function call must have the same number of arguments as there are parameters, and the arguments must be passed in the same order.
If all these parameters are meaningfully related, pack them in a structure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With