Jump to content

Halt and catch fire: Difference between revisions

C++ entry
(Added Wren)
(C++ entry)
Line 33:
This won't halt the CPU but the program will crash immediately on startup.
<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}}==
125

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.