c++ - CPP, 'X' button listener -
i'm writing cpp program, , want execute function when 'x'(shut down) button pressed.
for example, have infinite loop prints same thing everytime iterates, until 'x' button pressed, , want execute function before process ends.
is there kind of listener matter? or other solution maybe (like delaying process shut down few seconds or something)?
thanks!
if want execute before process ends, can register std::atexit handler. function called before process exits.
Comments
Post a Comment