+ 1

Are '\0' and NULL the same?

5th Jul 2025, 3:58 PM
Md Mehedi Hasan
Md Mehedi Hasan - avatar
1 Answer
+ 3
no '\0' is a char and NULL is a void pointer they can be compared as "nothing" and be equal because "nothing" is the same as "nothing." this detail is more obvious in assembly language (under the hood, all data is just numbers regardless of type so an empty void pointer is conventionally 0 and char '\0' is compiled as just the value 0, hence why they are "equal")
5th Jul 2025, 4:46 PM
ć€Œļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ 3O ļ¼Øļ¼„ļ¼¬ļ¼°ć€
ć€Œļ¼Øļ¼”ļ¼°ļ¼°ļ¼¹ 3O ļ¼Øļ¼„ļ¼¬ļ¼°ć€ - avatar