|
-
June 7th, 2002, 10:11 AM
#1
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 ?
-
June 7th, 2002, 01:09 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|