3 ms·
For multiple functions taking different arguments you could exploit atexit's specified calling order data_t *global; int main() { atexit(cal
by thedigitalengel 13y ago
For multiple functions taking different arguments you could exploit atexit's specified calling order
data_t *global;
int main() {
atexit(callback);
atexit(set_global_to_x);
atexit(callback);
atexit(set_global_to_y);
}
Since functions are called in reverse order of their installation using atexit, you end up with two calls to callback; one with global set to y and one with global set to x.