case constant_expr : statement | /* within switch only */ |
default : statement | /* within switch only */ |
break ; | /* within loop or switch */ |
continue ; | /* within loop */ |
Also allowed anywhere in the function body are :–
return ; | /* return from function */ |
return expression ; | /* return from function with value */ |
goto label_name ; | /* destination in the same function */ |
label_name : statement: | /* destination of goto */ |
You may notice that there are no “PRINT” statements or the like. The basic
philosophy of C does not allow them as you would find in BASIC, but all the useful
ones are supplied as functions (which can be evaluated as (part of) an expression)
in the system library.
Comments
As mentioned earlier, comments in C can occur almost anywhere, even in the middle
of an expression or between arguments of a function call. A comment starts with
“/*” and ends with “*/” and can contain any characters in between.
Data Names & Types
Variables in C are given names, the number of significant characters depending on
the implementation, and each has a specific type. The basic types allowed are:
int : | Signed integer, usually 16 bit. |
unsigned : | Unsigned integer of same size as int. |
short : | Signed integer, smaller size than int. |
long : | Signed integer, larger size than int. |
char : | Byte value, usually a character but can be unsigned integer. |
float : | Floating point value ( where implemented ). |
double : | Double precision float. |
On top of these, a variable can be defined as a pointer to any specific type, or as a
structure (struct) or union. Structures are the equivalent of Pascal’s record type,
and are essentially a fixed array whose members can be of different types. For
example: