| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Weird void** ?
Guys,
i don't know what is the difference between "void**" and "void"?? I even look through the msdn webside with that keyword.. but couldn't get any result... Can anyone explain to me ? |
|
#2
|
|||
|
|||
|
Re: Weird void** ?
|
|
#3
|
|||
|
|||
|
Re: Weird void** ?
alright.. base on the explanation from the msdn.. i understand that if
void --> for function usage; void* --> universal pointer; void** --> ? is void ** = &(void*)?? |
|
#4
|
|||
|
|||
|
Re: Weird void** ?
Yes, void** is ptr to void ptr.
|
|
#5
|
||||
|
||||
|
Re: Weird void** ?
void = Nothing. Not even for function declaration that do not return something...
Code:
// A function that has no arguments
int main ( void )
{
return 0;
}
Code:
// Cast to void, to tell the compiler to make an optimation for not checking and/or storing the return value
int main ( void )
{
(void)printf("Hello World\n");
return 0;
}
void** ... A pointer to a pointer. (A string array for example). Since void is nothing special at all you cannot use the [] operators to declare an array of pointers. So void * narf[] is not allowed because it is of an unspecified type of size. But for example char* narf[] would be allowed because the size of char is specified. To avoid this problem you write void ** which would be the same as void *[] if it would be allowed.
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
|
#6
|
|||
|
|||
|
Alright.. got it..
However, why isnt the one below working? IGraphBuilder* igb; IMediaControl* imc; void* tempimc = imc; temphr = igb->QueryInterface(IID_IMediaControl,&tempimc); i am getting the annoying error Stating that i "can't convert * __gc* to void**" may i know what is the matter? |
|
#7
|
||||
|
||||
|
Re: Weird void** ?
Quote:
__________________
I am not offering technical guidiance via email or IM Come on share your photo with us! CG members photo album! Use the Code Tags! |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|