Mikroelektronika MIKROE-738 Datenbogen
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
200
mikoC PRO for PIC32
MikroElektronika
Void Type
void
is a special type indicating the absence of any value. There are no objects of
void
; instead,
void
is used for
deriving more complex types.
Void Functions
Use the
void
keyword as a function return type if the function does not return a value.
void print_temp(char temp) {
Lcd_Out_Cp(“Temperature:”);
Lcd_Out_Cp(temp);
Lcd_Chr_Cp(223); // degree character
Lcd_Chr_Cp(‘C’);
}
Use
void
as a function heading if the function does not take any parameters. Alternatively, you can just write empty
parentheses:
main(void) { // same as main()
...
}
Generic Pointers
Pointers can be declared as
void
, which means that they can point to any type. These pointers are sometimes called
generic.
Derived Types
The derived types are also known as structured types. They are used as elements in creating more complex user-
defined types.
The derived types include:
- arrays
- pointers
- structures
- unions