首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
IOFFSETOF ICONTAINEROF IQUEUE_ENTRY
】的更多相关文章
IOFFSETOF ICONTAINEROF IQUEUE_ENTRY
#include <iostream> #define IOFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define ICONTAINEROF(ptr, type, member) ((type*)(((char*)((type*)ptr)) - IOFFSETOF(type, member)) ) #define IQUEUE_ENTRY(ptr, type, member) ICONTAINEROF(ptr,…
#define IOFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#include <iostream> #define IOFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) using namespace std; int main(){ struct Demo{ char sex; int id; }; cout << "IOFFSETOF(Demo, sex): " << IOFFSETOF(Demo, sex) << end…