Problem installing facets into locales explicitly

Discussion in 'C++' started by David List, Aug 6, 2003.

  1. David List

    David List Guest

    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?

    --
    Med venlig hilsen / Best regards
    David List
     
    David List, Aug 6, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YWxhbg==?=

    Datagrid sorting from different locales.

    =?Utf-8?B?YWxhbg==?=, Apr 21, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    =?Utf-8?B?YWxhbg==?=
    Apr 21, 2005
  2. William Payne

    Correct use of locales?

    William Payne, Dec 13, 2003, in forum: C++
    Replies:
    3
    Views:
    412
    Morten Hanssen
    Dec 13, 2003
  3. Replies:
    0
    Views:
    408
  4. Moof

    Python Locales under windows

    Moof, Oct 28, 2003, in forum: Python
    Replies:
    1
    Views:
    819
    =?UTF-8?B?0LTQsNC80ZjQsNC9INCzLg==?=
    Oct 28, 2003
  5. B.D.

    Problem using locales

    B.D., Feb 11, 2006, in forum: C++
    Replies:
    4
    Views:
    393
Loading...

Share This Page