sliceO_Class::Compare

 

This method compare 2 instances of a class and return a value < 0 if pt_b is "higher" than "this", 0 if they are identical and > 0 if pt_b is "smaller" than "this".

 

Usually this is done with a string comparison between the "Sort" string of both instances.

 

 

Syntax

 

int  Compare(

          SliceO_Class * pt_b

) ;

 

 

Parameters

 

pt_b

          Pointer to the other class to compare to

 

 

Return value

 

This method return a value < 0 if pt_b is "higher" than "this", 0 if they are identical and > 0 if pt_b is "smaller" than "this".

 

 

Remarks

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

Library:

          sliceO_Structures.lib

 

 

Example

 

// ----------------------------------------------------------------------------

//

//          Compare()

//

//          Comprae 2 frames:

//

//          param:          pt_b (SliceO_Class *)          Pointer to second node

//

//          return:          (int)          a value < = or > 0

//

// ----------------------------------------------------------------------------

int          SliceO_Class::Compare( SliceO_Class *pt_b )

{

          return( strcmp(this->Sort_Get(), pt_b->Sort_Get()) ) ;

}

 

See also