摘要
面向对象的程序设计语言,如C++,引入了"类"的概念。相似的对象通过归入某一"类"而联系起来。"类"使数据与程序的封装成为可能,让代码更加安全。由此引发的继承等概念,更是大大提高了语言的灵活性。然而使用类的时候,需要十分小心,以免带来潜在的安全隐患。MISRA C++指出了避免这些陷阱的方法。
The concept of class is brought to us by object oriented programming (OOP) language such as C++. Similar objects are connected through a certain class. The adoption of class enhances project safety by means of encapsulation. Furthermore, the inheritance relationship between derived class and base class gives extra flexibility to C++ language. However, in order to keep safety-related problems away, great care needs to be exercised when using class. MISRA C++ shows us how to avoid these traps.
出处
《单片机与嵌入式系统应用》
2009年第11期78-81,共4页
Microcontrollers & Embedded Systems