what is the use of \0 in array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mateen anjum
    New Member
    • Jan 2010
    • 1

    what is the use of \0 in array

    plz tell me the use of \0 in arrays as a condition
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    The character constant '\0' is the NULL character and has the value 0. Its only significance is in C strings which use zero terminated arrays of characters to represent the string. The 0, NULL or '\0' character thus terminates a string of characters by convention in C, that is everybody writes their code to operate like this and the standard library is written to operate like this, it is not an inherent feature of the language.

    Comment

    • puneetsardana88
      New Member
      • Aug 2009
      • 57

      #3
      Since there are no String data type in C, it is used to differentiate between array of characters and string. Any array of character terminated by Null is considered as string.

      Comment

      Working...