home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 216.lha / EdLib_v1.0 / bintoint.c < prev    next >
C/C++ Source or Header  |  1996-02-15  |  354b  |  17 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. /* this function takes a string of binary digits and returns its value */
  3. int bintoint(number)
  4. char *number;
  5. {
  6.     int value = 0;
  7.  
  8.     while ( *number )
  9.         if ( isbdigit(*number) ) {
  10.             value = (value << 1) + toint(*number++);
  11.         } else {
  12.             return(value);
  13.         }
  14.  
  15.     return(value);
  16. }
  17.