what is the difference between NULL('\0') and 0?
Answer Posted / shashwat
Actually binary code of both are same.
0 -> 00000000 NULL
But when this 0 is included in a string or char as
char x = '0';
or char x[20] = "1230";
It is the character zero (not NULL). It has an ASCII of 48
and will be stored as
00110000.
That is why, they have created different zeroes to
represent either the character zero or ASCII value zero.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain what is a stream?
Why is it important to memset a variable, immediately after allocating memory to it ?
What are linker error?
regarding pointers concept
What is the difference between memcpy and memmove?
What is an auto keyword in c?
Explain how do you sort filenames in a directory?
Write a program to check palindrome number in c programming?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is indirection?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What is void c?
How do I swap bytes?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What is the difference between null pointer and wild pointer?