Answered Questions

  • how can i find size of a variable without using sizeof() operator?

    reshma

    • Sep 16th, 2006

    What is the significance of using a char porinter in #define any_size(any) (char*)(&any)-(char*)((&any)-1) ?Why can't we use any other pointer there?

    Dan

    • Jun 6th, 2006

    A generic method for doing this would betypedef int MyType;MyType *p = 0;return (int) ++p;of course, the ++ operator uses sizeof itself, but this is still a valid answer to an interview question in my opinion.