next up previous contents
Next: Arbitrary Precision Integers Up: Fixed Precision Integers Previous: Header Files

Usage Examples

  #include "smallint.h"

  SmallInt::Class_name = "SmallInt";  // Set the global name (once-only)
  int
  main(int argc, char** argv)
  {
    SmallInt a = 5;                   // Creates a SmallInt type with value 5 
    SmallInt b = 8;                   // Creates a SmallInt type with value 8 
    SmallInt c = a+b ;                // Add a + b and store in c. 
    cout << c;                        // Prints result to standard output. 
    if (is_zero(c))                   // Test for zero
      cout << "Result is 0\n"; 
  }

1.0



Ashu Rege
Fri May 9 17:57:21 PDT 1997