Results 1 to 2 of 2

Thread: String headers

  1. #1

    Thread Starter
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772

    String headers

    Is there a difference between <string> and <cstring>?
    Alcohol & calculus don't mix.
    Never drink & derive.

  2. #2
    denniswrenn
    Guest
    <string> contains the string class, <cstring> contains the char* manipulation functions(strlen, etc...).


    Code:
    #include <string>
    using namespace std;
    int main()
    {
    string test = "a string";
    return(0);
    }
    Code:
    #include <cstring>
    using namespace std;
    int main()
    {
    char* test = "a string";
    int l = strlen(test); //gets the length of character pointer test.
    return(0);
    }

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