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

Do you know the difference between exit() and _exit() function in c?

1051


C program to find all possible outcomes of a dice?

2339


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1282


How a string is stored in c?

1051


What is the difference between the expression “++a” and “a++”?

1218


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

1097


how to create duplicate link list using C???

2546


the question is that what you have been doing all these periods (one year gap)

2073


Explain how can I convert a number to a string?

1144


i have a written test for microland please give me test pattern

2723


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

2089


Can you please explain the difference between exit() and _exit() function?

1017


Can the “if” function be used in comparing strings?

1035


What does sizeof function do?

1180


What is data types?

1072