devxlogo

Tip Bank

Restore the SQL Server master database

Restoring a corrupted master database is one of the most difficult tasks you may have to deal with. If this catastrophic event happens, here’s how to proceed. First, you need

Calling A Template Member Function

You can define a member function that is a template in a non-template class. For example: class A{public: template void func(); // member template }; How can you call such

Introducing Generators

A generator is a function or algorithm returning a series of values upon successive calls. The most common example is a random number generator although generators have many other useful

Converting a hex String to int

In a previous tip, I showed how to convert a string containing a hexadecimal to int using the sscanf() function. stringstream objects can perform this feat too, in a more

Converting char to wchar_t

The standard iostream family of classes defines the widen() member function which converts a single char to its wide-character equivalent. widen() has the following prototype: char_type widen(char c) const; The

Converting wchar_t to char

In addition to the widen() member function, the iostream framework supports the narrow() member function which performs the reverse operation, i.e., converting a wide character to its corresponding char value.