Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between NULL('\0') and 0?

Answer Posted / 111

What is the difference b/w '\0' and NULL?

The first is the representation for the null character, i.e.,
a character with value zero. It is used as a string
terminator in C.
It is actually an "escape sequence" with an octal zero.

The second is a macro that resolves to a null pointer value.
In C source
code a literal zero is also converted into a null pointer
constant when
it occurs in a pointer context.

The first expression is of type int while the second is of a
pointer
type.

> In which case It is useful?

Use '\0' to terminate strings and NULL to initialise
pointers and set
them to a "safe" value after they have been used.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the header file and its usage in c programming?

1072


What is volatile keyword in c?

1037


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2882


How many types of errors are there in c language? Explain

990


Explain union. What are its advantages?

1081


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

1281


What is meant by high-order and low-order bytes?

1051


What is sizeof array?

1060


Explain how can I make sure that my program is the only one accessing a file?

1225


What is the difference between the local variable and global variable in c?

966


What is static and auto variables in c?

1091


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3971


Why can’t we compare structures?

1276


How to write a multi-statement macro?

1049


What is the advantage of an array over individual variables?

1241