“捕获" C ++上的命令 [英] "catch" command on C++
本文介绍了“捕获" C ++上的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
我在用C ++编写程序,当我从名称为"catch"的类中定义对象时,我注意到这是一个诸如"int"或"double"之类的命令.
我想了解有关捕获"的信息,因为我对此感到好奇.
谢谢.
Hi.
I was writing on c++ and when i go to define a object from a class with the name "catch", i noticed this is a command such as "int" or "double" .
I wanna informations about "catch", because i curious about it.
Thanks.
推荐答案
''catch"是保留字,用于
''catch'' is a reserved word, used in exception handling.
It allows for a function to abort processing in case of an error, in a safe manner.
When an exception is thrown, objects on the stack are properly unwound and their destructors called. The appropriate catch statement in the try / catch block is then executed to handle the error.
请参阅:
http://en.wikipedia.org/wiki/Structured_exception_handling [ http://en.wikipedia.org/wiki/Barbara_Liskov [
Please see:
http://en.wikipedia.org/wiki/Structured_exception_handling[^].
This is one of the most fundamental and important inventions in programming of all times and peoples, mostly pioneered by Barbara Liskov at al (http://en.wikipedia.org/wiki/Barbara_Liskov[^]).
Today, anyone using any imperative of functional programming but not using or understanding this part of technology cannot be considered as a software developer, software engineer or a programmer. Not in any sense. Never. Not in any circumstances. Learn it now. Learn it very well. No excuses. This is not hard to learn.
—SA
这篇关于“捕获" C ++上的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文