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?

Answers were Sorted based on User's Feedback



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

Answer / sri

null(\0) is used for strings,and there is difference
between \0 and 0.

Is This Answer Correct ?    25 Yes 1 No

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

Answer / shani chaudhari

null(\0) is used for termination of string meance each and
every string ended with \0 while 0 is mostly related with
binary operations..null(\0) meance nothing but 0 has its own
value and existance. both are different

Is This Answer Correct ?    11 Yes 0 No

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

Answer / guest

NULL('\0')- A string in C is always terminated by a null
character.The ascii value of '\0' is 0
0 - The ascii value of 0 is 48

Is This Answer Correct ?    10 Yes 3 No

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

Answer / guest

ASCII value of 0 is 0,but ASCII value of '\0' is 27.

Is This Answer Correct ?    22 Yes 16 No

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

Answer / 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

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

Answer / palani222samy

NULL is an the empty value but 0(zero) is an one of the value

Is This Answer Correct ?    7 Yes 4 No

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

Answer / 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

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

Answer / 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

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

Answer / madhu

end of the string is indicated by \0 but 0 is a value
thus there is difference between them

Is This Answer Correct ?    2 Yes 2 No

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

Answer / mangal

The nul is used for the string so there is no any character
contain by null
but
The o is an intiger value an they have some meaning fot
that in intiger type

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

difference between semaphores and mutex?

1 Answers  


How do you determine if a string is a palindrome?

1 Answers  


write program on arrays

3 Answers   GE, Polycab,


How are strings stored in c?

0 Answers  


What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these

2 Answers   Oracle,


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


what is the use of macro program

1 Answers   TCS,


If null and 0 are equivalent as null pointer constants, which should I use?

0 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1 Answers   IBM,


Explain what is the difference between functions abs() and fabs()?

0 Answers  


Is main is user defined function?

0 Answers  


Categories