X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: in g++(invalid use of incomplete type) Date: Mon, 11 Jul 2011 20:54:17 +1200 Lines: 42 Message-ID: <97vs3fF61iU1@mid.individual.net> References: <9216c5aa-78f7-43cd-9957-dea63f1b5a84@34g2000pru.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net LUwwGoXDKsQ/SkHBYTmZiwFU6q8W+VNF0Wh3mwP3IS7dljPn2w Cancel-Lock: sha1:ADXrcjdTW6Ed8Z355KE7tDlRsso= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: <9216c5aa-78f7-43cd-9957-dea63f1b5a84@34g2000pru.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:7724 On 07/11/11 07:31 PM, eric wrote: > > -----------------------------------------------------the program I > used to compile is----------------------- > // Example 5-4 formatting a datetime string > #include > #include > #include > #include > #include > #include > #include > #include > > using namespace std; > > ostream& formatDatetime(ostream& out, const tm& t, const char* fmt) { > const time_put& dateWriter = use_facet >> (out.getloc()); In which standard header is time_put declared? Check for balance of < and >. > int n = strlen(fmt); > if (dateWriter.put(out, out, ' ',&t, fmt, fmt + n).failed()) { > throw runtime_error("failure to format date time"); > } > return out; > } > > string dateTimeToString(const tm& t, const char* format) { > stringstream s; > formatDateTime(s, t, format); Names are case sensitive! > return s.str(); > } -- Ian Collins