Problem installing facets into locales explicitly

D

David List

I seem to have a problem installing facets into locales explicitly. It
is not clear to me whether the problem is my compiler, my environment
or my code.

I am trying out some code from Langer/Kreft's iostream book. Here is
an example:

----------main.cpp----------
#include <string>
#include <locale>
#include <iterator>
using namespace std;

int main()
{
locale loc(locale("German"), new num_put<char,
back_insert_iterator<string> >);
}
----------main.cpp----------

This one sentence alone compiles, but gives me a segmentation fault
when run. The code is from the Langer/Kreft book page 308 (only the
first sentence in the example).

What could cause this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top