New standard string data types.

This is a discussion on New standard string data types. within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I've been messing around with strings a lot for various game programming tasks and have realized using the standard C ...

  1. #1
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584

    New standard string data types.

    I've been messing around with strings a lot for various game programming tasks and have realized using the standard C library for strings is a nightmare.

    Are there any plans to port the C standard string functions over to newer string types like Unicode instead of just using char?

    Converting between them has become a real pain. And then you have the ATL/MFC conversion macros which look like alphabet soup.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Are you talking about <wchar.h>, or something else?

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,584
    Yes wchar.h. Is this part of the standard now b/c most of the CRT still requires a char pointer as a parameter to the string functions.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    According to that page, it has been part of the standard since 95. The functions were available on Windows 95.

    There is still no standard support for opening files with unicode file names but Windows NT provides the _wfopen function. In fact, MSVC provides wide character versions of most functions that take a string, but many of these are not standard.

  5. #5
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    echo everything that everybody else has said. wchar.h works great.

    There is also something else I wanted to suggest, depending on your needs and what you have available. C++ (not C) has a standard string class (i think it is called string.h...but i would have to double check).

    If you are just using C, then you couldnt make use of it, but even if you are using C++, the standard string class might be a little too much for your needs. It is quite a nice class though.
    My Website

    "Circular logic is good because it is."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 02:27 AM
  2. String Class
    By BKurosawa in forum C++ Programming
    Replies: 117
    Last Post: 08-09-2007, 01:02 AM
  3. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21