Results 1 to 4 of 4

Thread: String Class

  1. #1

    Thread Starter
    Junior Member random150's Avatar
    Join Date
    Mar 2001
    Location
    USA
    Posts
    30
    Hi
    I would like to make more c++ apps but i cant find out how to make a string class close to vbs string class
    the char[] arrary is to code consuming to be of any use in many different scenarios.
    Is there a premade class that i just dont know of in the c++ librarys. And if soo what library and how do i use it.

  2. #2
    Guest
    Code:
    char* MyString;
    If you want a library of strings and string functions, include "String.h"

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    It is not string.h but just string (it's a library)
    Use it like this:
    Code:
    #include <string>
    using namespace std;
    
    int main()
    {
    string mystr; //declaration
    mystr = "my";
    mystr = mystr + "string";
    printf(mystr.c_str ());
    //prints mystring
    //pretty much like VB
    return 0;
    }
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4

    Thread Starter
    Junior Member random150's Avatar
    Join Date
    Mar 2001
    Location
    USA
    Posts
    30
    hey thanx for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width