devxlogo

July 11, 1998

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

When can an empty class be useful?

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