RAD Studio
ContentsIndex
PreviousUpNext
void

Category 

Special types 

Syntax  

void identifier

Description 

void is a special type indicating the absence of any value. Use the void keyword as a function return type if the function does not return a value.

void hello(char *name)
{
printf("Hello, %s.",name);
}

Use void as a function heading if the function does not take any parameters.

int init(void)
{
return 1;
}

Void Pointers 

Generic pointers can also be declared as void, meaning that they can point to any type. 

void pointers cannot be dereferenced without explicit casting because the compiler cannot determine the size of the pointer object. 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!