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
阅读全文
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
阅读全文
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
阅读全文
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
阅读全文