Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C#
C# Reference
C# Keywords
Types
 void

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
C# Language Reference
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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
System.Void cannot be used instead of void      David M. Kean ... David Streeter   |   Edit   |   Show History
Although void is an alias for .NET Framework System.Void type, using the latter in code will generate a CS0673 compiler error.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker