Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
4.1.2, 4.1.3, 4.1.4
-
None
-
Windows
Description
Moved from the Rogue Wave bug tracking database:
***Created By: sebor @ Apr 29, 2003 01:34:21 PM***
-------- Original Message --------
Subject: puzzle
Date: Tue, 22 Apr 2003 12:31:46 -0600
From: "L. Nicoara" <nicoara@roguewave.com>
To: Martin Sebor <sebor@roguewave.com>
This program prints A - Windows, VC7 (also 15d). Is there anything
obviously wrong with it?
Liviu
#include <iostream>
#include <sstream>
#include <locale>
#include <cstring>
int main ()
{
const char* fmt = "%c";
tm t = tm ();
t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_mday = 13;
t.tm_mon = 8;
t.tm_year = 67;
t.tm_wday = 3;
t.tm_isdst = 0;
typedef std::ostreambuf_iterator<char> iter_t;
std::locale loc ("C");
std::ostringstream os;
iter_t os_iter(os.rdbuf ());
const std::time_put<char,iter_t>& fac =
std::use_facet<std::time_put<char,iter_t> >(loc);
fac.put(os_iter,os,os.fill(), &t, fmt, fmt + std::strlen (fmt));
std::cout << "Date-time : " << os.str().c_str () << std::endl;
return 0;
}
Attachments
Issue Links
- is related to
-
STDCXX-676 [MSVC] 22.locale.time.put test fails
- Closed