Results 1 to 3 of 3

Thread: Is void a type?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Is void a type?

    Hey,

    This is a question that popped up in class. We need to write some source documentation and someone consistently wrote something like:
    Methods:
    GetImage(): of type Image.
    GetName(): of type string.
    Move(): of type void.
    etc...
    Now, this seemed weird to me, reading "of type void" makes it sound like void is a type like any other (string, int, etc).

    Is it?

    Is this question open to interpretation, or is there an 'official definition'?

    It's not a big deal, but the same person likes to be very strict in the documents, using the exact terminology for everything (which I do encourage), so I found it odd to see 'of type void', as I've never seen void as a type... Am I wrong?

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Re: Is void a type?

    void is a type. That is official.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Is void a type?

    From the MSDN documentation for the void keyword:
    void is an alias for the .NET Framework System.Void type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width