Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1006 B

  1. /***
  2. * istrdbl.cpp - definition for operator>>(double) member funct for istream class
  3. *
  4. * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Definition of operator>>(double) member function for istream class.
  8. * [AT&T C++]
  9. *
  10. *Revision History:
  11. * 09-26-91 KRS Created. Split off from istream.cxx for granularity.
  12. * 12-30-92 KRS Fix indirection problem with **endptr.
  13. * 06-14-95 CFW Comment cleanup.
  14. *
  15. *******************************************************************************/
  16. #include <cruntime.h>
  17. #include <internal.h>
  18. #include <stdlib.h>
  19. #include <iostream.h>
  20. #pragma hdrstop
  21. #pragma check_stack(on) // large buffer(s)
  22. #define MAXDBLSIZ 28
  23. istream& istream::operator>>(double& n)
  24. {
  25. _WINSTATIC char ibuffer[MAXDBLSIZ];
  26. char ** endptr = (char**)NULL;
  27. if (ipfx(0))
  28. {
  29. if (getdouble(ibuffer, MAXDBLSIZ)>0)
  30. {
  31. n = strtod(ibuffer, endptr);
  32. }
  33. isfx();
  34. }
  35. return *this;
  36. }