A Super-Efficient Toggle Case Using XOR
My benchmarking shows that ToggleCase can crunch through a 2,000,000character string in under 4 seconds on a Pentium II. Public Function ToggleCase(ByVal strData As String) As String ‘This technique gets
My benchmarking shows that ToggleCase can crunch through a 2,000,000character string in under 4 seconds on a Pentium II. Public Function ToggleCase(ByVal strData As String) As String ‘This technique gets
The following code causes a somewhat cryptic warning message: struct Employee{ long ID; string name;};Employee emp;void func(int& id) { id=0;}// warning below issued for the following call:func(emp.ID);
To right justify the output of cout, call the width() function with the size of the output screen (in characters) as an argument. In the following example, the program calls
A header file should begin and end with #include guards to guarantee that it’s not #included more than once during the same compilation session. A typical #include guard looks as
It’s possible to use the format function to retrieve the decimal separator.Use the following statement: sTemp = Format(0,
It’s faster to enumerate a collection with the For each…Next statetment: Dim c As Class1 For Each c In Col ‘Code… NextDim fldField As ADODB.Field For Each fldField In rsTemp
In pre-standard C++, certain implementations of offered the flags ios::nocreate and ios::noreplace for controlling file creation. These flags were too platform-specific and never made it into the standard library, which
C++ defines the symbolic constants EXIT_SUCCESS and EXIT_FAILURE that you can use as return codes. These macros are defined in the header file ( in C) as follows: #define EXIT_SUCCESS
This is a common source of misunderstanding: a programmer creates a container of pointers, then fills that container with pointers to dynamically allocated objects. When the container is destroyed, the