Thursday 16 March 2017

C

Q; How to find the offset of Structure member?

struct info{
        char a;
        int b;
        char c;
        int d;
};
struct info myinfo;


int main(int argc, char **argv)
{
   struct info *ptr = &myinfo;
   unsigned int offset;


   offset = (unsigned int) &((struct info *) 0)->d;
   printf("Offset = %d\n",offset);


   return 0;
}



Tree:



An AVL tree is a binary search tree which has the following properties:




  1. The sub-trees of every node differ in height by at most one.
     2.  Every sub-tree is an AVL tree.

No comments:

Post a Comment