switch case

Thread Solved

Join Date: Jun 2007
Posts: 22
Reputation: aasi007onfire is an unknown quantity at this point 
Solved Threads: 1
aasi007onfire's Avatar
aasi007onfire aasi007onfire is offline Offline
Newbie Poster

switch case

 
0
  #1
Jun 21st, 2007
"We can also have null statements by just including a ; or let the switch statement fall through by omitting any statements (see e.g. below).

The default case is optional and catches any other cases."


i found these lines about the switch case statement in a site.... i couldn't understand what is meant by null statement here......

the link to the page is
http://www.cs.cf.ac.uk/Dave/C/node5....00000000000000

can somebody help me please......
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,608
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: switch case

 
0
  #2
Jun 21st, 2007
A null statement is just a semicolon. It's a statement that does nothing. For example:
  1. #include <stdio.h>
  2.  
  3. int main ( void )
  4. {
  5. printf ( "Blah\n" ); /* Statement */
  6.  
  7. ; /* Null statement */
  8.  
  9. return 0;
  10. }
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC