How many bytes are required to store the pointer?

1 answer

Answer

1013575

2026-07-22 20:36

+ Follow

It depends on the platform...

In a 16 bit environment, such as DOS or Windows 3.x, a near pointer is two bytes, while a far pointer is 4 bytes.

In a 32 bit environment, such as Win32, a pointer is 4 bytes.

In a 64 bit environment, such as Win64, a pointer is 8 bytes.

If you want to find out in your particular environment, look at sizeof(ptr), where ptr is declared as a pointer to something.

char* ptr;

std::cout << sizeof(ptr) << std::endl;

Note that the size of the pointer is not the same as the size of the object to which it points. If you looked at sizeof(*ptr), you would get 1.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.