suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Was macht Exit(EXIT_FAILURE)?

exit(EXIT_TRUE), führt Folgendes aus:

1. Objects associated with the current thread with thread storage duration are destroyed (C++11 only).

2. Objects with static storage duration are destroyed (C++) and functions registered with atexit are called.

3. All C streams (open with functions in <cstdio>) are closed (and flushed, if buffered), and all files created with tmpfile are removed.
Control is returned to the host environment.

Was ist mit Exit(EXIT_FAILURE)?

仅有的幸福仅有的幸福2759 Tage vor1180

Antworte allen(1)Ich werde antworten

  • 滿天的星座

    滿天的星座2017-05-31 10:40:51

    EXIT_SUCCESSEXIT_FAILURE是两个常量。一般EXIT_SUCCESS=0EXIT_FAILURE=1

    exit()函数先处理完上面你列出的许多后事,最后将它的参数返回给操作系统作为exit status。所以从exit函数本身执行来说并没有什么不同。不同的是操作系统对这个exit status的解释。一般0表示程序寿终正寝,1表示死于非命。

    Antwort
    0
  • StornierenAntwort