what is the difference between NULL('\0') and 0?
Answer Posted / salim
I am going to speak in cotext to c language.
NULL is a macro defined in header files such as
stdio.h,stdlib.h,alloc.h,stddef.h,mem.h.The c pre processor
substitutes NULL by the value 0.Its declaration appears to
be like #define NULL 0 in the standard libraries.It is
used to initialise pointers to 0 and helps in portability.
It is a null pointer constant a convention for programmers
to initialise pointers.It is used mainly with pointer.
0 is simply an integer constant.
/0 is a backslash character contant used to indicate end of
string or a string terminator.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Why doesnt long int work?
Why do we use main function?
Write a program which returns the first non repetitive character in the string?
Explain what are the different data types in c?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Why is c so popular?
What are different types of operators?
Why is c still so popular?
What is the heap in c?
What is the meaning of typedef struct in c?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are structures and unions? State differencves between them.
Implement bit Array in C.