Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アプリケーションでファイルを読み書きするときに、ファイルが正しく閉じられていない場合は exit(1) を使用したいと考えています。Windows では問題なく動作しますが、Linux では次のエラーが表示されます。
‘exit’ was not declared in this scope
どうすれば解決できますか?
ありがとう。
これがCの場合、あなたはしました #include <stdlib.h>か?
#include <stdlib.h>
これがC++の場合、cstdlibを含める必要があります。
#include <cstdlib>