Difference
Get difference between successive elements of the vector
BOOL Difference( vectorbase& vecDiff )
Returns TRUE on success and FALSE on error.
EX1
void vectorbase_Difference_ex1() { // Declare data vector and fill with some data vector<int> vecData = {23, 12, 7, 28}; // Declare vector to hold differences and call method vector<int> vecDiff; BOOL bRet = vecData.Difference(vecDiff); if( !bRet ) out_str("Failed to computed difference vector"); else { for (int i = 0; i < vecDiff.GetSize(); i++ ) printf("%d ", vecDiff[i]); } // On success, result should be: // vecDiff = -11 -5 21 }
Get the difference between successive elements of a vector.
origin.h