Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Null-terminated string
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Data structure}} {{Redirect|CString||C string (disambiguation)}} {{see also|String (computer science)#Null-terminated}} {{Use dmy dates|date=August 2021}} In [[computer programming]], a '''null-terminated string''' is a [[character string]] stored as an [[Array data structure|array]] containing the characters and terminated with a ''[[null character]]'' (a character with an internal value of zero, called "NUL" in this article, not same as the [[glyph]] zero). Alternative names are ''[[C string handling|C string]]'', which refers to the [[C (programming language)|C programming language]] and '''ASCIIZ'''<ref>{{Cite web |title=Chapter 15 - MIPS Assembly Language |url=https://people.scs.carleton.ca/~sivarama/org_book/org_book_web/solution_manual/org_soln_one/arch_book_solution_ch15.pdf |access-date=2023-10-09 |website=Carleton University}}</ref> (although C can use encodings other than [[ASCII]]). The length of a string is found by searching for the (first) NUL. This can be slow as it takes O(''n'') ([[linear time]]) with respect to the string length. It also means that a string cannot contain a NUL (there is a NUL in memory, but it is after the last character, not {{em|in}} the string).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)