answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many bytes are read in pointers by pointers dereferencing?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is dangling pointer reference?

Whenever memory that was in use, and was referred to by a pointer variable, is freed, and the pointer variable is not updated accordingly (setting it to NULL, for example), the pointer variable is considerred to be a dangling pointer reference.


Major c plus plus feature that were removed from java?

Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.


How many bytes of date can be addressed by a computer system with an 11-bit address bus and an 8-bit data bus?

There can be one byte of data transferred at one time on the 8-bit data bus, but without knowing more about the architecture and the address and data bus multiplexing we cannot know how many bytes can be addressed.Perhaps the machine architecture uses 2 address bus cycles to send out a 16-bit address and 6-bits of control signals, then uses 2 data bus cycles to read or write the 16-bit word at that address, which would mean this computer system addressed two bytes at one time.Perhaps the machine architecture uses 3 address bus cycles to send out a 32-bit address and a 1-bit control signal, then uses 4 data bus cycles to read or write the 32-bit word at that address, which would mean this computer system addressed four bytes at one time.Perhaps the machine architecture uses 6 address bus cycles to send out a 64-bit address and 2-bits of control signals, then uses 8 data bus cycles to read or write the 64-bit word at that address, which would mean this computer system addressed eight bytes at one time.Perhaps the machine architecture has a variable word length (which could be specified in many different ways depending on the architecture), in which case almost any number of bytes could be addressed at one time (with different numbers of bytes in each addressing operation).There are many other possibilities.


To read data which is superior 1. input stream 2. file reader?

First of all, these two classes are on different levels of abstraction. An InputStream is used for reading any stream of bytes, while a FileReader is used to read characters from a file. If you want to ask between a FileInputStream and a FileReader, then we need to look at what type of data you are reading. If you're reading plain-text file, for example, you want to use a FileReader because it was designed to read in characters. For other types of data, the FileInputStream would be better, as it is used to read in generic streams of bytes from a file.


When does segmentation fault occur for a prog?

You either reference memory that is non existent, or you attempt to modify memory that is read only. This is usually a result of failure to properly initialize or use pointers or arrays.

Related questions

How the computer processes data?

It converts the data into bytes, a form which it can easily read


What is dangling pointer reference?

Whenever memory that was in use, and was referred to by a pointer variable, is freed, and the pointer variable is not updated accordingly (setting it to NULL, for example), the pointer variable is considerred to be a dangling pointer reference.


How can you access the administrator password using pointers in C?

i don't have any knowledge about your ques. but i guide you to read the "Writing TSR through C" & learn knowledge of FAR & HUGE ponters.by this you can access the adminstrator password using pointers in C.


What is MSCam532exe?

You will see MSCams32.exe if you have any of Microsoft Life Cam products installed on your PC. Below is some extra information (from link in related links)MSCamS32.exe is located in a subfolder of "C:\Program Files". Known file sizes on Windows XP are 271,720 bytes (35% of all occurrence), 207,664 bytes, 240,408 bytes, 161,632 bytes, 164,896 bytes, 139,632 bytes, 139,120 bytes, 156,704 bytes. The program is not visible. The file is digitally signed. The file is not a Windows core file. Therefore the technical security rating is 37% dangerous, however also read the users reviews.


How do you explain what near far and huge pointers are to a beginner?

If you're a beginner you don't need to worry about near and far pointers. They are a concept that have been obsoleted on most PCs. If you are programming for an embedded device, read the datasheet. It will explain it in terms of the device you are programming for.


Pointers on how to spelled correctly?

pay close attention to whatever you read while looking for mistakes in it & especially study as much latin & greek as possible


What is acceptable and unacceptable computer practices in south Africa?

read the guide bytes people solution gave you and stop being lazy


Major c plus plus feature that were removed from java?

Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.


When burning a CD what is the difference between 12x and 48x?

How long does it take to write a CD-R or CD-RW disc?The amount of time taken to write a disc depends upon the speed of the recorder, the writing method used by the recorder and the amount of information required to be written. Recording speed is measured the same as the reading speed of ordinary CD-ROM drives and players. At single speed (1x) a recorder writes 150 KB (153,600 bytes) of data (CD-ROM Mode 1) per second and at a multiple of that figure at each speed increment above 1x.CD Read and Write Average Data Transfer Rates(transfer rates indicated in bytes)Read/WriteAudioCD-ROMMode 1CD-ROMMode 2CD-i/XAForm 1CD-i/XAForm 2Speed (CLV)(2,352 Bytes/Block)(2,048 Bytes/Block)(2,336 Bytes/Block)(2,048 Bytes/Block)(2,324 Bytes/Block)1x176,000153,600175,200153,600174,3002x352,800307,200350,400307,200348,6004x705,600614,400700,800614,400697,2006x1,058,400921,6001,051,200921,6001,045,8008x1,411,2001,228,8001,401,6001,228,8001,394,40012x2,112,0001,843,2002,102,4001,843,2002,091,60016x2,816,0002,457,6002,803,2002,457,6002,788,80020x3,520,0003,072,0003,504,0003,072,0003,486,000


Which is bigger MB or KB?

MB... 1 MB is 1024 KB (1024 bytes) of disk space. If you are referring to data transfer rates instead, 1 MB is 1000 KB (1000 bytes). Network types rarely refer to bytes per second, but use bits per second instead. So if you are asking because you've read that something is transferred at 2MBps, it likely means 2,000,000 bits per second, not bytes per second.


What is a full name of EEPROM?

EEPROM stands for Electrically Erasable Programmable Read-Only Memory. It is non-volatile memory whose bytes can be individually altered, to reprogram the chip, so it is not entirely read-only.


What are some effective good laser pointer brands?

Yes, laser pointers can be effective for your teaching. I am not sure what brand are best , but you can read reviews on various brands on amazon.com. Good luck.