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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are run-time errors?

614


Was 2000 a leap year?

635


Can we assign integer value to char in c?

619


What does c value mean?

635


What does nil mean in c?

676






What is a dynamic array in c?

599


What is the difference between array and linked list in c?

606


Can an array be an Ivalue?

668


How can you determine the size of an allocated portion of memory?

748


Can you define which header file to include at compile time?

593


How do we declare variables in c?

579


What is data structure in c programming?

578


In C, What is the #line used for?

1073


What is floating point constants?

695


Explain modulus operator.

601