B
bakzam
struct filo{
float p;
};
typedef int (*func)filo, int);
int main(void){
func(-1); //Hmmm. what's this?
return 0;
}
why is func(-1) working?
Actually, I found this (equivalent code) in DON BOX's book
--------------------
typedef HRESULT (*INTERFACE_FINDER) (void *pThis, DWORD dwData, REFIID
riid, void **ppv);
//pseudo-function to indicate entry is just an offset
#define ENTRY_IS_OFFSET INTERFACE_FINDER(-1)
float p;
};
typedef int (*func)filo, int);
int main(void){
func(-1); //Hmmm. what's this?
return 0;
}
why is func(-1) working?
Actually, I found this (equivalent code) in DON BOX's book
--------------------
typedef HRESULT (*INTERFACE_FINDER) (void *pThis, DWORD dwData, REFIID
riid, void **ppv);
//pseudo-function to indicate entry is just an offset
#define ENTRY_IS_OFFSET INTERFACE_FINDER(-1)