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

What is array of structure in c?

1094


What are variables c?

996


what is the difference between class and unio?

2302


Explain what is the difference between a free-standing and a hosted environment?

1125


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

1161


What is the default value of local and global variables in c?

981


What is the use of header files?

1054


Is main is user defined function?

1069


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2398


Distinguish between actual and formal arguments.

1011


What is a program?

1181


What is the difference between single charater constant and string constant?

1028


Explain what is the heap?

1010


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1084


What is the difference between void main and main in c?

1094