c0ding
Watching Debug Message ( qDebug usage )
In QT qDebug is compiled as some winapi function.
fun task
Print “0”, if N equal zero, and “1” in another case. For solution you can use only arithmetic operations.
Static Initialization Function in Classes
Content
Sometime when we write a C++ class, we want a static function is used to initialize the class. For example, a static function is used to initialize a static vector or map. We can do the same thing easily in Java, by Java’s static block. How we can do with C++?
At first, let’s see how to initialize a normal static member in C++.
class Test1 { public:static string emptyString; }; string Test1::emptyString = ""; // also can be // string Test1::emptyString; // string Test1::emptyString("");