gpt4 book ai didi

编译器不允许在 C 中使用 exit() 函数

转载 作者:太空宇宙 更新时间:2023-11-04 01:06:21 26 4
gpt4 key购买 nike

我正在上在线编程类(class),我有作业要完成,所以我的问题是我无法使用exit(0);在这个在线编译器中,我不知道这是哪个编译器,但是该类(class)由 Google 提供支持。

无论如何,我得到的错误是:

Program:18:1: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
Program:18:1: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default]

所以我很无奈,它在其他编译器中工作正常,即 DEV c++ 和 turbo c++,所以请任何人帮助我!

最佳答案

您需要为 exit 包含 stdlib.h

关于编译器不允许在 C 中使用 exit() 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22427703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com