Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

void (C# Reference)

When used as the return type for a method, void specifies that the method does not return a value.

void is not allowed in a method's parameter list. A method that takes no parameters and returns no value is declared as follows:

void SampleMethod();

void is also used in an unsafe context to declare a pointer to an unknown type. For more information, see Pointer types (C# Programming Guide).

void is an alias for the .NET Framework System.Void type.

For more information, see the following sections in the C# Language Specification:

  • 1.6.5 Methods

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft