D 语言中有类似于 PHP 中的 exit() 函数的函数,名为 std.stdlib.exit。它可以用于中止程序的运行,可以在测试和调试时方便地使用。例如:

import std.stdlib;

void main() { // some code here exit(0); // or any other integer value }

当程序执行到 exit 函数时,程序将会立即停止,并返回指定的整数值。

D 语言中的退出函数:类似 PHP 的 exit() 函数

原文地址: http://www.cveoy.top/t/topic/oyaw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录