What is a null statement in C language?
Menu

digit

 

Results 1 to 12 of 12

Thread: What is a null statement in C language?

  1. #1
    Pawned!... Beyond GODLIKE fun2sh's Avatar
    Join Date
    May 2006
    Location
    World Of Warcraft -DOTA
    Posts
    1,062

    Default What is a null statement in C language?

    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 by fun2sh; 12-07-2007 at 07:12 PM. Reason: Automerged Doublepost
    Popular Gadget Deals
    If God has indeed created Himself in His own image, then I submit to you that God is a cockroach :mrgreen:!!!!!!!!

  2. #2
    Banned slugger's Avatar
    Join Date
    May 2004
    Location
    Baudland
    Posts
    2,430

    Default Re: What is a null statement in C language?

    you cud check out the meaning of Null Statement from here
    Last edited by slugger; 12-07-2007 at 08:06 PM.

  3. #3
    C# Be Sharp ! Zeeshan Quireshi's Avatar
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    1,805

    Default Re: What is a null statement in C language?

    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
    There are 10 types of people in the world: those who understand binary and those who do not.

  4. #4
    Resident Fanatic Manshahia's Avatar
    Join Date
    Jul 2006
    Location
    /Milky way/earth/india/
    Posts
    910

    Default Re: What is a null statement in C language?

    wat is its use then??
    ----------

  5. #5
    Broken In
    Join Date
    Apr 2005
    Posts
    133

    Default Re: What is a null statement in C language?

    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..
    Abhishek Bhattacharya

  6. #6
    The Frozen Nova casanova's Avatar
    Join Date
    Sep 2004
    Location
    Trespasser in Virtual Land
    Posts
    1,641

    Default Re: What is a null statement in C language?

    It says don't do anything. Used mostly in conditions and loops.
    I dream of a better tomorrow... where chickens can cross roads and not have their motives questioned.

    www.nerdweed.blogspot.com

  7. #7
    C# Be Sharp ! Zeeshan Quireshi's Avatar
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    1,805

    Default Re: What is a null statement in C language?

    Quote Originally Posted by Manshahia
    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
    There are 10 types of people in the world: those who understand binary and those who do not.

  8. #8
    -The BlacKCoaT Operative- Rollercoaster's Avatar
    Join Date
    Mar 2005
    Location
    Dehradun, India
    Posts
    1,206

    Default Re: What is a null statement in C language?

    one possible use in loops

    for ( ; ; ) {
    ....
    ....
    ....
    }
    --------------------------------------------
    Holding my last breath, safe inside myself.....
    --------------------------------------------
    I dont use my computer. I misuse it- रोलरकोस्टर

  9. #9
    Pawned!... Beyond GODLIKE fun2sh's Avatar
    Join Date
    May 2006
    Location
    World Of Warcraft -DOTA
    Posts
    1,062

    Default Re: What is a null statement in C language?

    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
    If God has indeed created Himself in His own image, then I submit to you that God is a cockroach :mrgreen:!!!!!!!!

  10. #10
    eWebGuru ahref's Avatar
    Join Date
    Mar 2006
    Location
    Dehradun
    Posts
    427

    Default Re: What is a null statement in C language?

    Quote Originally Posted by fun2sh
    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
    I think many of the above post also says same thing.
    Windows and linux hosting at http://www.ewebguru.com
    Get $50 per blog post PM me for details.

  11. #11
    Right Off the Assembly Line tanvi chaturvedi's Avatar
    Join Date
    Apr 2007
    Posts
    21

    Default Re: What is a null statement in C language?

    hy was goin thru it... n ques struck in mind..
    Q: wats d ASCII value of NULL..
    Q: in characters hw to represent NULL.. ?

  12. #12
    eWebGuru ahref's Avatar
    Join Date
    Mar 2006
    Location
    Dehradun
    Posts
    427

    Default Re: What is a null statement in C language?

    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.. ?
    Windows and linux hosting at http://www.ewebguru.com
    Get $50 per blog post PM me for details.

Similar Threads

  1. Need help with mySQL statement
    By Sridhar_Rao in forum Programming
    Replies: 1
    Last Post: 15-06-2009, 12:09 PM
  2. goto statement in JAVA
    By Shloeb in forum Programming
    Replies: 15
    Last Post: 23-06-2008, 09:23 PM
  3. help for the following statement
    By nitinm in forum Programming
    Replies: 4
    Last Post: 05-03-2008, 08:42 PM
  4. ':' turning into label statement
    By redhat in forum Programming
    Replies: 13
    Last Post: 04-02-2008, 12:25 AM
  5. reset jradiobuttton in a group to NULL !!!
    By tweety_bird_bunny in forum QnA (read only)
    Replies: 2
    Last Post: 28-09-2006, 11:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •