Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

sint.h

Go to the documentation of this file.
00001 // sint header file.
00002 // Contains defineiton os sint variable class.
00003 
00004 #include <stdio.h>
00005 #include <string.h>
00006 
00007 class digit_stream;
00008 
00009 
00010 class sint {
00011   
00012   protected:
00013   
00014     char* digits;
00015     int  ndigits;
00016   
00017     sint(char* d, int n) {
00018       digits = d;
00019       ndigits = n;
00020     }
00021     friend digit_stream;
00022     
00023   public:
00024     
00025     sint(const char*);
00026     sint(int); 
00027     sint(const sint&); 
00028     void operator = (const sint&);
00029     sint operator + (const sint&);
00030     void print();
00031     ~sint() {delete digits;}
00032 };
00033 
00034 class digit_stream {
00035   
00036   protected:
00037   
00038   char* dp;
00039   int nd;
00040   
00041   public:
00042   
00043     digit_stream(const sint& n) {
00044       dp = n.digits;
00045       nd = n.ndigits;
00046     }
00047     int operator++() {
00048       if (nd==0) return 0;
00049       else {
00050         nd--;
00051         return *dp++;
00052       }
00053     }
00054 };
00055 

Generated at Sun Feb 24 09:57:16 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001