cannot compile (formatting a Date/Time as a String)
Dear Ubuntu programers by g++:
I copied a piece simple (Formatting a Date/Time as a String) program
from book(c++ cookbook), chapter5 Section2, Example5-4, on page 201.
on my g++4.5.
you can get that example code from
http://
to test by yourself
I got compile errors
-------
eric@eric-
Example5-4.cpp: In function ‘std::ostream& formatDatetime(
const tm&, const char*)’:
Example5-
struct std::time_
/usr/local/
++/4.5.
std::time_
Example5-4.cpp: In function ‘std::string dateTimeToStrin
const char*)’:
Example5-
scope
In file included
from /usr/local/
++/4.5.
from /usr/local/
++/4.5.
from /usr/local/
++/4.5.2/ios:43,
from /usr/local/
++/4.5.
from /usr/local/
++/4.5.
/usr/local/
++/4.5.
std::use_
Example5-
/usr/local/
++/4.5.
‘std::time_
/usr/local/
++/4.5.
*(__facets + ((unsigned int)(((unsigned int)__i) * 4u)))’ (of type
‘const class std::locale:
std::time_
type)
eric@eric-
-------
need your help to fix it
and thanks a lot in advance
Eric
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Edward Benson for more information if necessary.