Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : ISXLONG.C

 
Output of file : ISXLONG.C contained in archive : CUJ0894.ZIP
-------------------------- Listing 6: long integer extractor ---------

// isxlong -- istream::operator>>(long&)
#include
#include
#include

istream& istream::operator>>(long& lo)
{ // extract a long
_TRY_IO_BEGIN
if (!ipfx())
setstate(failbit);
else
{ // gather characters and convert
char ac[_MAX_INT_DIG];
char *ep;
errno = 0;
const long x = strtol(ac, &ep, _Getifld(ac));
if (ep == ac || errno != 0)
setstate(failbit);
else
lo = x;
}
isfx();
_CATCH_IO_END
return (*this);
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : ISXLONG.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/