Halt and catch fire: Difference between revisions

Content added Content deleted
(Added Wren)
(C++ entry)
Line 33: Line 33:
This won't halt the CPU but the program will crash immediately on startup.
This won't halt the CPU but the program will crash immediately on startup.
<lang algolw>assert false.</lang>
<lang algolw>assert false.</lang>

=={{header|C++}}==
Use an unhandled exception to crash the program.
<lang cpp>#include <stdexcept>
int main()
{
throw std::runtime_error("boom");
}</lang>
{{out}}
<pre>
terminate called after throwing an instance of 'std::runtime_error'
what(): boom
</pre>
The output depends on the compiler and platform but should be similar.


=={{header|Raku}}==
=={{header|Raku}}==