[Favorites] How to construct a function executed outside of MAIN

xiaoxiao2021-03-05  25

Below is a code example:

The article comes from the 9CBS Forum. . . . .

#include #include

Void Fn1 (Void), FN2 (Void), FN3 (Void), FN4 (Void)

INT main (void) {Atexit (fn1); Atexit (FN2); Atexit (FN3); Atexit (FN4); Printf ("this is executed first./n"); system ("pause");}

Void fn1 () {Printf ("next./n"); system ("pause");}

Void fn2 () {Printf ("executed"); system ("pause");}

Void Fn3 () {Printf ("IS"); System ("Pause");}

Void fn4 () {Printf ("this"); system ("pause");}

转载请注明原文地址:https://www.9cbs.com/read-34717.html

New Post(0)