For example:
sizeof(char*)
returns 4. As does int*
, long long*
, everything that I\'ve tried. Are there any exceptions to this?
Just another exception to the already posted list. On 32-bit platforms, pointers can take 6, not 4, bytes:
#include
#include
int main() {
char far* ptr; // note that this is a far pointer
printf( "%d\n", sizeof( ptr));
return EXIT_SUCCESS;
}
If you compile this program with Open Watcom and run it, you'll get 6, because far pointers that it supports consist of 32-bit offset and 16-bit segment values