Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 4
    I haven't used C in a long time, but I can't think of a time when I ran into an implementation that did not use NULL-terminated strings. It's part of standard C, if I remember correctly (like I said, it's been a while...) Commented Mar 21, 2017 at 13:25
  • 1
    I'm not a specialist in C, but as far as I know all strings in C are arrays of char, null-terminated. You can create your own string type though, but you'd have to implement all string manipulation functions by yourself. Commented Mar 21, 2017 at 13:26
  • 1
    Possible duplicate of Should functions of a C library always expect a string's length? Commented Mar 21, 2017 at 13:26
  • 1
    @MetalMikester You think that this information could be found in the standard C spec? Commented Mar 21, 2017 at 13:39
  • 3
    @Snoopy Most likely, yes. But really, when talking about strings in C, they're just an array of characters that end with NULL and that's that, unless you use some kind of non-standard string library but that's not what we're talking about here anyway. I doubt you'll find a platform that doesn't respect that, especially with one of C's strengths being portability. Commented Mar 21, 2017 at 13:55