purely out of curiosity, does anyone know the size of a pointer in memory (under Windows OS)?
purely out of curiosity, does anyone know the size of a pointer in memory (under Windows OS)?
sizeof(void*)
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
thanks, should have thought of that myself
http://www.eskimo.com/~scs/C-faq/q5.17.html
You should regard each pointer as a different type, which may have a different representation than other pointer types (and consequently, a different size).
I suppose the implication of this (given the rules for C) that a void* pointer is big enough to hold any pointer type (since assignment to void* and back again preserves information).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.