(a) 
ptr->command.arg1 = 1; 
ptr->command.arg2 = 2; 

(b) 
#include <sys/mman.h> 
#include "myheader.h" 
munmap(ptr, sizeof(MY_STRUCT)); 

Example 3: (a) Dereferencing the pointer; (b) passing the pointer and the size of its object.

Back to Article
Copyright © 1999, Dr. Dobb's Journal