Tip Bank

DevX

Translating errno Error Codes to Text

To translate an error code to its verbal description, use the function strerror(). strerror() is declared in as follows: char * strerror(int errcode); The function takes an error code and

DevX

The sig_atomic_t Datatype

Applications that handle signals must distinguish between atomic and non-atomic datatypes. Reading or writing an atomic object is guaranteed to take one instruction. By contrast, accessing a non-atomic object may

DevX

Obtaining a Verbal Description of errno

System calls and Standard Library functions assign a zero value to the global variable errno to indicate success. In case of an error, they assign negative values to errno. On

DevX

Defining a Template Member Function

You can define a template member function in an ordinary class as follows: class C{public: template int func(T* p);};template int C::func(T* p){ return 0;} Note that Visual C++ doesn

DevX

Duplicate the Join Function for VB4 and VB5

The native VB6 Split and Join functions have highlighted a number of useful techniques, and VB5 and VB4 programmers can use this extended facility as well. This code emulates the

DevX

Retrieve Additional File Properties

Several new properties associated with files were not available when the original VB file I/O statements and functions were designed. To easily access these new properties

DevX

Store Primary Key in ItemData

Loading a combo/listbox is pretty easy, and determining what the combo/listbox Text property selects is even easier. But if you load a table that contains duplicate values, you might run