Mixing C and C++ IO. What extra syncing do I need ?
(Please ignore portability issues, as this is just for fun)
But If I call this function twice in a row...and cout the strings returned, they seem to output after the second one is returned, even when I use endl in between.
std::string InputUI(std::string msg="Input",int numchars=50)
std::string command = "kdialog --inputbox \"" + msg + "\"";
auto f = popen(command.c_str(),"r");
char* ret = new char[numchars];
std::string ret_str = std::string(ret);
delete  ret;
Other than that, this seems to work fine for me, but have I missed something obvious?