String Class

This is a discussion on String Class within the C++ Programming forums, part of the General Programming Boards category; Hi all, I'm having trouble with finding a descent string class, I don't want to use the MFC CString class, ...

  1. #1
    JBravo
    Guest

    Question String Class

    Hi all,
    I'm having trouble with finding a descent string class, I don't want to use the MFC CString class, is there any other that I could use?
    thanks,
    DOnal

  2. #2
    Unregistered
    Guest
    you could try using the string objects in <string.h>

  3. #3
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    There's std::string.

  4. #4
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136

  5. #5
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    you could try apstring. Its the AP college board's string class. downloadable for free.
    My Website

    "Circular logic is good because it is."

  6. #6
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    I've heard about that before. Where are the details on that??

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    What's wrong with the standard string class?

    >you could try using the string objects in <string.h>
    You mean <string>

    -Prelude
    My best code is written with the delete key.

  8. #8
    JBravo
    Guest
    Thanks for the tips, but I can't seem to get any of the string classes to work.

    e.g.
    #include<String.h>

    void main()
    {
    string mystring;
    basic_string mystring1;
    String mystring3;
    }

    none of these will work, I get "undeclared identifier" for each one.
    Any Ideas or examples??
    Thanks,
    Donal

    ps I'm using MS Visual C++ 6.0

  9. #9
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    You need to include <string>, not <string.h> then

    string mystring;

    will work if you bring the whole of the std namespace into global scope, or just std::string. Either -

    using namespace std;

    or

    using std::string;

    Also main returns an int not void.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String Class
    By BKurosawa in forum C++ Programming
    Replies: 117
    Last Post: 08-09-2007, 01:02 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  5. class object manipulation
    By guda in forum C++ Programming
    Replies: 2
    Last Post: 10-09-2004, 10:43 AM

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