Results 1 to 3 of 3

Thread: Strings

  1. #1
    tbarnette
    Guest

    Strings

    'Mornin folks.

    I just read another thread about comparing two strings. I haven't used C since MS VC 1.51. I dont recall a string type. Is this something new? Will it work like other languages? Does it no longer need a null terminator?

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    There is a standard string class in C++. It's in the std namespace. There's no string class in C, obviously.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    As far as null terminators go...

    ...no, they don't need one any more, since the strings are stored by length (also making asking for the length a fast operation).

    Unfortunately, I think there are situations when you use .c_str() to get a const char* pointer to the content of a string...when I get home and have access to a compiler (a good one, the ones at work are x centuries out of date) I'll check it out for you.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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