摘要
异常处理是程序开发的一个重要内容,异常处理的好坏关系到程序的友好程度和系统的稳定性。C++是一种纯面向对象的编程语言,其异常处理机制和普通的编程语言有很多不同的地方,有力地增强了C++程序的健壮性和容错性。文中从介绍其运行步骤入手,通过一个简单的例子,详细阐述了C++异常处理机制的规则和栈展开技术,并扼要地对比了函数调用和异常处理的异同点,以便更好地在C++面向对象程序设计中正确使用异常处理机制。
Exception handling plays a significant role in programming development. Its performance will influence the friendliness and stability of the system. As a complete object oriented programming language, the exception handling mechanism of C + + is very different from other programming language, and effectively improves robustness and tolerance of the programs. This paper began with the introduetion of the running steps, and then illustrated the rule of exception handling mechanism and the technology of stack unwinding by a test example. Finally it concisely compared the Similarities and differences of function transferring and exception handling in order to make precise use of the mechanism in the object oriented prngramming.
出处
《计算机技术与发展》
2007年第1期128-129,132,共3页
Computer Technology and Development
关键词
C++
异常处理
栈展开
C + +
exception handling
stack unwinding