+ 5
What is \0 in C language and what is it's use? (with example please).
3 Antworten
+ 3
'\0' is referred to as NULL character or NULL terminator
It is the character equivalent of integer 0(zero) as it refers to nothing
In C language it is generally used to mark an end of a string.
example string a="Arsenic";
every character stored in array
a[0]=A
a[1]=r
a[2]=s
a[3]=e
a[4]=n
a[5]=i
a[6]=c
end of the array contain ''\0' to stop the array memory allocation for string 'a'.
+ 4
M.Yoganayaki is right. \0 is a null character in C!! 😄
+ 3
In c ,\0 is known as null character. Basically, In string concept, string is complete with this null character.