随笔分类 -  C/C++ Beyond

 
Casting Operators
摘要:There are several casting operators specific to the C++ language. These operators are intended to remove some of the ambiguity and danger inherent in old style C language casts. These operators are: dynamic_cast: Used for conversion of polymorphic types.static_cast: Used for conversion of nonpolymor 阅读全文
posted @ 2009-08-09 12:21 做个不善的人 阅读(639) 评论(0) 推荐(0)
Character types in C and C++
摘要:How many built-in character types are there in C++? The answer may surprise you.The language described in the original 1978 C Programming Language (aka "the White Book") by Kernighan and Ritchie didn't have the keyword signed, meaning that there were only two character types: char and 阅读全文
posted @ 2009-07-08 22:57 做个不善的人 阅读(705) 评论(0) 推荐(0)
Why c++ has friend members while C# does not have this?
摘要:First, let us examine how the Controlling Access to Class Members is defined:Member-Access Control Type of AccessMeaningprivateClass members declared as private can be used only by member functions and friends (classes or functions) of the class.protectedClass members declared as protected can be us 阅读全文
posted @ 2009-07-05 11:38 做个不善的人 阅读(697) 评论(0) 推荐(0)
Inside C++ new/delete and new[]/delete[]
摘要:When talking about new there are two distinct parts: the operator new, and the function operator new(). The last time I went over this with somebody, it took them ages to get it. What happens is that the operator new calls the function operator new() to allocate memory. The function operator new() a 阅读全文
posted @ 2009-07-05 10:35 做个不善的人 阅读(552) 评论(1) 推荐(0)