944,052 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 1865
  • C RSS
Jun 21st, 2007
0

switch case

Expand Post »
"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......
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
aasi007onfire is offline Offline
22 posts
since Jun 2007
Jun 21st, 2007
0

Re: switch case

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. }
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: c software execution optimization
Next Thread in C Forum Timeline: how to time program execution





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC