





String literals are const
According to the C++ standard, the following line is illegal: char *s = “hello world”; //illegal Though still supported by many compilers, it’s deprecated and should be avoided. The reason
According to the C++ standard, the following line is illegal: char *s = “hello world”; //illegal Though still supported by many compilers, it’s deprecated and should be avoided. The reason
In many frameworks and software projects, all classes are enforced to be descendants of one common generic class, usually named Object. This design policy prevails in other OO language such
A reference is always bound to the same object. When that object is destroyed, any use of its reference yields undefined behavior. The following example may demonstrate that: int &
If you don’t want users of your class to be able to assign objects of its type (password string objects are a good example), you can declare a private assignment
A class containing no data members and no member functions is an empty class. It’s defined like this: class PlaceHolder {}; What’s it good for? It can serve as a