"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.html#SECTION00500000000000000000

can somebody help me please......

A null statement is just a semicolon. It's a statement that does nothing. For example:

#include <stdio.h>

int main ( void )
{
  printf ( "Blah\n" ); /* Statement */

  ; /* Null statement */

  return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.