RAD Studio |  |

void

Category

Special types

Syntax

Copy Code

    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.

Copy Code

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

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

Copy Code

    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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!