Memcmp Data Member Function

Compares two objects using the memcmp function. Returns 0 if the objects match exactly. Otherwise returns non-zero.

Prototype

int32 Memcmp( Color lhs, Color rhs, int32 p_nCount )

Parameters

Parameter Type Parameter Name Documentation
<Color>lhsA pointer to the left hand object.
<Color>rhsA pointer to the right hand object.
int32p_nCountThe number of bytes to compare.

Examples

Copy Text To Clipboard

auto Color a = new Color( 255, 128, 64, 255 );
auto Color b = new Color( 255, 128, 64, 255 );
auto Color c = new Color( 128, 64, 32, 255 );

auto ColorAlgorithms a_oAlgorithms;
Console.Out( a_oAlgorithms.Memcmp( a, b, a.SizeInBytes() ) );
Console.Out( a_oAlgorithms.Memcmp( b, c, b.SizeInBytes() ) );

Results

0
1