What is a null statement in C language?

Status
Not open for further replies.

fun2sh

Pawned!... Beyond GODLIKE
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
 
Last edited:

Zeeshan Quireshi

C# Be Sharp !
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
 

abhishek_del

Journeyman
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..
 
OP
fun2sh

fun2sh

Pawned!... Beyond GODLIKE
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

In the zone
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.
 
Status
Not open for further replies.
Top Bottom