answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Try this:

printf ("a pointer requires %d bytes\n", (int)sizeof (void *));

Usually 2, 4 or 8.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many bytes are required to store the pointer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many bytes are required to store an float in ADA?

four


How many bytes are required to store an unsigned integer range?

4


How many bits or bytes required to store the robot?

40 bits or 5 byrtes


How many bytes are required to store a character string?

about eight bits, which is equal to one byte


How many bytes are read in pointers by pointers dereferencing?

When you dereference a pointer you "read" the number of bytes determined by the pointer's type. That is, a char pointer dereferences a single byte while an int pointer dereferences 4 bytes (assuming a 32-bit int) -- regardless of the type actually stored at that address. However, note that a pointer can only actually point at a single byte since it only has storage for a single memory address. How many additional bytes are dereferenced is entirely dependant on the type of the pointer. To determine how many bytes are actually allocated to an address, use the sizeof operator, passing a dereferenced pointer (the pointer must point at the start of the allocation). If the pointer points at several elements of the same type (an array), then divide the total bytes by the size of the pointer's type to determine the number of elements in the array.


How many bytes are used to store a 64-bit number?

how many bytes are there in a 64-bit machine? Another Answer: It takes 8 bytes to store a 64 bit number.


How many bytes are required for LCALL?

3-byte


How many bytes are used to store a 64 bit number?

how many bytes are there in a 64-bit machine? Another Answer: It takes 8 bytes to store a 64 bit number.


How many bytes in a pointer address?

Suppose that we're talking about C on an x86 32-bit processor it should be 4-bytes (32-bits). Since the pointer has to be able to hold any memory location it should be the same number of bits as the processor.


How many bytes are needed to store 32767?

32767 is the maximum value that can be stored in two bytes.


How many bytes of data can a 60 gb hard drive store?

61440 Mega Bytes(MB) that is 62914560 Kilo bytes(KB) that is 64424509440 BYTES....- Mayank


How many bytes are needed to store 'n'?

Three: ' n '