devxlogo

Tip Bank

Copy Constructor’s Signatures

C++ defines four possible forms for a class’s copy constructor. For a class called X, a copy constructor can have one of the following forms: X(X&);X(const X&);X(volatile X&);X(const volatile X&);

Constructor Names

Technically speaking, constructors have no name. This may seem strange at first because you define a constructor for class X as X::X(). However, this construct is not the name of

Returning a Value from a Function that Throws

A reader asked me the following questions: “Can a function that returns something, throw a exception and still return a value?” Lets’ look at a concrete example: int f(){ if

TransposeMatrix – Rotate a bi-dimensional array

‘ evaluate the transposed matrix” a transposed matrix is the array you get when’ you “rotate” a bi-dimensional arrayFunction TransposeMatrix(arr() As Double) As Double() Dim startRow As Long, startCol As

Measuring Small Increments of Time in VB

In Visual Basic, it is not possible to measure time with more precision than one second. This code allows the user to measure time passed in increments less than one