Re: problem with num_get

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: P.J. Plauger (pjp_at_dinkumware.com)
Date: 05/08/04


Date: Sat, 8 May 2004 06:26:50 -0400


"Yongling Ding" <ylding@comcast.net> wrote in message
news:y4adnfY_WZmhzwHdRVn-hQ@comcast.com...

> The following code seems to stop parsing right at the first ":" so that
only
> the hour field is read. The code was compiled with msvc 7.1. Any clue?

I just tried it with V7.0 and it worked fine. My V7.1 is temporarily
damaged, from installing so many trial compilers the past few months.
But I can't see any material change in the code in get_time (in
<xloctime>). No clue.

> #include <locale>
> #include <iostream>
> #include <iterator>
> #include <sstream>
>
> int main ()
> {
> typedef std::istreambuf_iterator<char,std::char_traits<char> >
iter_type;
>
> std::locale loc;
> struct tm timeb;
> std::memset(&timeb, 0, sizeof(tm));
> std::ios_base::iostate state;
> iter_type end;
>
> const std::time_get<char,iter_type>& tg =
> std::use_facet<std::time_get<char,iter_type> >(loc);
> std::istringstream ins("06:46:32");
> iter_type begin(ins);
>
> std::cout << *tg.get_time(begin,end,ins,state,&timeb) << std::endl;
>
> std::cout << timeb.tm_hour << std::endl
> << timeb.tm_min << std::endl
> << timeb.tm_sec << std::endl;
>
> return 0;
> }

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com



Relevant Pages

  • Re: WWDC -- MacBook Pro?
    ... I do have a clue. ... Honest. ... one isn't allowed to discuss in a Mac group. ... Flex/Bison, constructing some compilers, and followed the comp.compilers ...
    (comp.sys.mac.system)
  • Re: The coming death of all RISC chips.
    ... To blame naivete about compilers and languages on Intel-HP management ... Clue had known that the relevant technology was infeasible since the ... Clue to high enough levels in the project is NOT a management failure? ...
    (comp.arch)
  • Re: I just want to install Firebird!
    ... >> differences between variants) I have experience with, I had no clue this ... >> would work in Linux with this particular library, ... > link level between different compilers, ... and I guess I just shove the c++ libs that this version of glibc is ...
    (alt.os.linux)
  • Re: Different VICE builds?
    ... Stephan Schmid wrote: ... > That's quite a boost ... I've got no clue about C++ ... > and compilers in general. ...
    (comp.emulators.cbm)
  • switching mex compiler from lcc to MSVC - need a couple of tips!
    ... For compiling mex files, I want to switch from LCC to MSVC, because I want to ... I don't have MSVC++ 2005 v8 Pro package, but my needs are very simple and I ... I don't know about anything about resource compilers and manifest tools. ...
    (comp.soft-sys.matlab)