wchar_t

Discussion in 'C++' started by Gaijinco, Jun 8, 2006.

  1. Gaijinco

    Gaijinco Guest

    I'm from Colombia a country where we speak spanish. I had always used
    char's and the standard functions for I/O and other matters that had to
    deal with characters.

    However today I tried to use some things with wchar_t with poor
    results.

    The first problem is that there is almost none documentation. I checked
    books from Deitel & Deitel, O'Reilly, Sam, Addison Wesley but none had
    anything about wchar_t. I tried google but then again there was nothing
    really useful and the information I found was a little inacurate as I
    tried to compile programs with it.

    Does someone knows of a good source of information? Does have anyone
    used wchar_t and survived?

    Thanks a lot.
     
    Gaijinco, Jun 8, 2006
    #1
    1. Advertising

  2. Gaijinco

    Mike Wahler Guest

    "Gaijinco" <> wrote in message
    news:...
    > I'm from Colombia a country where we speak spanish. I had always used
    > char's and the standard functions for I/O and other matters that had to
    > deal with characters.
    >
    > However today I tried to use some things with wchar_t with poor
    > results.
    >
    > The first problem is that there is almost none documentation. I checked
    > books from Deitel & Deitel, O'Reilly, Sam, Addison Wesley but none had
    > anything about wchar_t. I tried google but then again there was nothing
    > really useful and the information I found was a little inacurate as I
    > tried to compile programs with it.
    >
    > Does someone knows of a good source of information? Does have anyone
    > used wchar_t and survived?


    Exactly what did you try to do with type 'wchar_t'?
    What results did you expect, what results did you
    get, and what was the difference?

    -Mike
     
    Mike Wahler, Jun 10, 2006
    #2
    1. Advertising

  3. Gaijinco

    Gaijinco Guest

    For starters I'm trying to print "Ahí está el problema"

    It was supposed to be along the lines of:

    #include <wchar.h>
    #include <iostream>
    using namespace std;

    int main()
    {
    wcout << L"Ahí está el problema";
    return 0;
    }

    But the compiler says it doesn't find "wcout".
     
    Gaijinco, Jun 11, 2006
    #3
  4. Gaijinco

    Mike Wahler Guest

    "Gaijinco" <> wrote in message
    news:...
    > For starters I'm trying to print "Ahí está el problema"


    First note that the 'wide character' type (wchar_t)
    is not specified by C++ to include all of the
    characters in your string literal above. Your
    operating system and/or implementation must provide
    that.

    > It was supposed to be along the lines of:


    > #include <wchar.h>


    You don't need this header in C++, where 'wchar_t' is
    a keyword (i.e. it's a built-in type).

    > #include <iostream>


    This header declares the standard built-in stream objects,
    including the 'wide stream' objects such as 'std::wcout'.

    > using namespace std;


    > int main()
    > {
    > wcout << L"Ahí está el problema";
    > return 0;
    > }


    > But the compiler says it doesn't find "wcout".


    Therefore your compiler does not conform to the
    C++ standard. Try a different compiler (or perhaps
    a more current version of the one you're using).

    -Mike
     
    Mike Wahler, Jun 11, 2006
    #4
    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. Adrian Cornish
    Replies:
    2
    Views:
    8,258
    Adrian Cornish
    Jul 12, 2003
  2. Bren
    Replies:
    4
    Views:
    4,199
    Peter van Merkerk
    Oct 7, 2003
  3. sorty
    Replies:
    4
    Views:
    20,838
    Rolf Magnus
    Nov 25, 2003
  4. Jon Willeke

    wchar_t -> UTF-8?

    Jon Willeke, Feb 8, 2004, in forum: C++
    Replies:
    2
    Views:
    7,630
    Tilman Kuepper
    Feb 9, 2004
  5. Replies:
    3
    Views:
    1,193
    James Kanze
    Aug 15, 2008
Loading...

Share This Page