Results 1 to 3 of 3

Thread: Strings question (Newbie)

  1. #1
    NOMADMAN
    Guest

    Strings question (Newbie)

    How do you use/declare strings.

    I have #include <string.h> is that the one I need? I tried declaring my string as:
    string myString;

    didn't work.

    NOMAD

  2. #2
    Zaei
    Guest
    Code:
    #include <string>
    ...
    std::string myString;
    or
    Code:
    #include <string>
    using namespace std;
    ...
    string myString;
    Z.

  3. #3
    Lively Member
    Join Date
    Nov 2001
    Location
    fl
    Posts
    92
    i bought a book it has an example like this:

    #include <iostream>
    #include <cstring>
    using namespace std;

    char str1[], str2[], strout[];

    int main()
    {
    str1 = 'ABC';
    str2 = 'def';
    strout = str1 + str2;
    cout << strout;

    return 0;
    }

    you mean it will not work in vc++ 6.0?
    and explain me please why I get errors on the above code

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