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
What are loops c?
Define Spanning-Tree Protocol (STP)
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What is nested structure with example?
What are the basic data types associated with c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is string in c language?
Define macros.
Array is an lvalue or not?
What is null pointer in c?
What are the 4 data types?
What is header file definition?
What is wrong in this statement? scanf(ā%dā,whatnumber);
What is string constants?
Write a program to swap two numbers without using a temporary variable?