KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Isn't a pointer just an address? Or I'm missing something? I tested with several types of pointers: pointers to any variables is the same (8B on my platform) pointers to functions are the same size, as pointers to variables (8B again) pointers to functions with different parameters - still the same (8B) BUT pointers to member functions are bigger - 16B on my platform. Three things: Why are pointers to member functions bigger? What more information do they need? As far as I know, the standard says nothing about the size of a pointer, except that void* must be able to "contain" any pointer type. In other words, any pointer must be able to be casted to void* , right? If so, then why sizeof( void* ) is 8, while sizeof a pointer to member function is 16? Are there any other examples for pointers, that are with different size (I mean, for standard platforms, not some rare and special ones)?
Tags (comma-separated)
Save Edits
Cancel