Tip Bank

DevX - Software Development Resource

The const pass-by-value

Question: void foo(const int x) { // not altering x} Herb Sutter in Exceptional C++, pg.177 says, “const pass-by-value is unuseful and misleading at best.” I disagree, at a glance

DevX - Software Development Resource

Deprecated APIs

Question: How do I make a method deprecated? Answer: Deprecating a method or entire class is as simple as using the “@deprecated javadoc” tag in its documentation. For example: /**

DevX - Software Development Resource

Using errno in DLLs

C++ inherited from C the global variable errno which indicates the success status of a previous operations. An errno value of 0 indicates that the previous operation was successful whereas

DevX - Software Development Resource

The vector::data() Member Function

In a previous tip, I discussed techniques for treating a vector object as an array. The two main forms of obtaining the internal array’s address are: &*v.begin(); // obtain address

DevX - Software Development Resource

Uninitialized enum Variables

The value of an uninitialized automatic enum variable is indeterminate. Uninitialized global and static enum variables have a zero value by default. In this regard, enum variables are similar to

DevX - Software Development Resource

The Modulus Operator

The operator % returns the remainder of dividing its two operands. For example: b=10%3; // b equals 1 Don’t confuse the modulus operator with the division operator: c=10/3; // division,

DevX - Software Development Resource

Designing Custom Forms

Question: Is it possible to make changes to the text on the tabs? Answer: Sure, with the tab you want to change selected, just click Form > Rename This Page.