OAR

RTEMS GNU Tools On-Line Library


The Function Type

prev UP NEXT Bookshelf GNU Readline Library

2.2.1: The Function Type

For readabilty, we declare a new type of object, called Function. A Function is a C function which returns an int. The type declaration for Function is:

typedef int Function ();

The reason for declaring this new type is to make it easier to write code describing pointers to C functions. Let us say we had a variable called func which was a pointer to a function. Instead of the classic C declaration

int (*)()func;

we may write

Function *func;

Similarly, there are

typedef void VFunction ();
typedef char *CPFunction (); and
typedef char **CPPFunction ();

for functions returning no value, pointer to char, and pointer to pointer to char, respectively.


prev UP NEXT Bookshelf GNU Readline Library

Packaging copyright © 1988-2000 OAR Corporation
Context copyright by each document's author. See Free Software Foundation for information.