Typedef Specifier - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers

Typedef Specifier

Specifier
def
defined by the language or for types that you have declared. You cannot use the
typedef
The specifier
typedef <type-definition> synonym ;
The
synonym
Declaration starting with the
function of a given type, but rather a new name for a given type. That is, the
typedef
declares types. It is a common practice to name custom type identifiers with start-
ing capital letter — this is not required by C.
For example:
// Let's declare a synonym for "unsigned long int":
typedef unsigned long int Distance;
// Now, synonym "Distance" can be used as type identifier:
Distance i; // declare variable i of unsigned long int
In typedef declaration, as in any declaration, you can declare several types at once.
For example:
typedef int *Pti, Array[10];
Here,
"array of 10
page
92
introduces a synonym for a specified type. You can use
typedef
declarations to construct shorter or more meaningful names for types already
specifier inside a function definition.
stands first in the declaration:
typedef
keyword assigns the
typedef
needs to be a valid identifier.
declaration is identical to "normal" declaration, but instead of objects, it
is synonym for type "pointer to
Pti
elements".
int
MikroElektronika: Development tools - Books - Compilers
to the
synonym
specifier does not introduce an object or
typedef
", and Array is synonym for type
int
making it simple...
. The
<type-definition>
mikroC
type-

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents