DIGIT-ARC read-only archive · snapshot: July 23, 2026

What is a null statement in C language?

12 posts · originally from https://geek.digit.in/community/threads/what-is-a-null-statement-in-c-language.62790/

fun2sh
fun2sh Original post #1
Jul 12, 2007 at 7:12 PM
hi guys today my first sem computer exams got over.
one question in paper was WHAT IS A NULL STATEMENT? how it is useful? can some1 tel me the ans.
i wrote a statement followed by double semi colon where second semi colon acts like a null statement. m i right?

koi to batao bhai log
slugger
slugger #2
Jul 12, 2007 at 8:00 PM
you cud check out the meaning of Null Statement from here
Zeeshan Quireshi
Jul 12, 2007 at 8:11 PM
simply saying a nul statement is a "blank" statement , it absolutely does not do anything , it is terminated like any normal statement by a semicolon ';' .

e.g.
Code:
int x=5; // this stament is not null
; // this one's null
x=9; //another statement
Manshahia
Jul 12, 2007 at 8:27 PM
wat is its use then??
A
Jul 12, 2007 at 8:41 PM
it is like

int *p=NULL;
here p is a pointer and above statement, initializes a pointer p with null value....this is what is null, nothing else....
It is useful in pointers, to check if they are not inititalized to wrong places or not pointing to places where windows is using the memory..
casanova
Jul 12, 2007 at 9:03 PM
It says don't do anything. Used mostly in conditions and loops.
Zeeshan Quireshi
Jul 12, 2007 at 9:09 PM
Manshahia said:
wat is its use then??
it's used in loops n stuff when you don't want to do anything and the syntax demands that you provide atleast one statement for execution :)
Rollercoaster
Jul 13, 2007 at 4:36 AM
one possible use in loops

for ( ; ; ) {
....
....
....
}
fun2sh
fun2sh #9
Jul 13, 2007 at 6:34 AM
hey its a blank followed by a semicollon. just like wat i said. i checked on net. i got the result. it seems u guys hav to study C a bit more:mrgreen:
ahref
ahref #10
Jul 13, 2007 at 8:24 AM
fun2sh said:
hey its a blank followed by a semicollon. just like wat i said. i checked on net. i got the result. it seems u guys hav to study C a bit more:mrgreen:
I think many of the above post also says same thing.
T
Jul 13, 2007 at 7:27 PM
hy was goin thru it... n ques struck in mind..
Q: wats d ASCII value of NULL..
Q: in characters hw to represent NULL.. ?
ahref
ahref #12
Jul 13, 2007 at 7:36 PM
ASCII value =0
represented as '\0'
hy was goin thru it... n ques struck in mind..
Q: wats d ASCII value of NULL..
Q: in characters hw to represent NULL.. ?