CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    China
    Posts
    6

    who can tell me why C++ does not support a void reference but support a void pointer

    I think if we could use void reference, it could make many things much easier and bring much flexibility.
    But it must be initialized when you declared it. Why C++ does not support it ?

  2. #2
    Join Date
    May 2000
    Location
    Washington DC, USA
    Posts
    715

    It's in the definition of void.

    By definition there can't be a void variable and thus can't be a void refference to a void variable.

    'void' when used as a function return type means the function returns nothing.

    'void' when used as a function parameter means that the function takes no parameters.

    'void' when used as a pointer type means that the pointer type is a universal pointer but can not be derrefferenced without having first been cast to a specific and different type of pointer.

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

Featured