answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

Which of the correct way of declaring the float pointer?

float *pointer;


What is a fat pointer?

It is 'flat', and it means unstructured, i.e. it has no segment and offset parts.


What is triple pointer?

Example: int x; -- integer int *px= &x; -- pointer to integer int **ppx= &px; -- pointer to pointer to integer int ***pppx= &ppx; -- pointer to pointer to pointer to integer


Why pointer variable size of is 4bytes in 32 bit compiler?

Because 32 bit is exactly four bytes.


Explain pointer of any data type that requires four bytes?

When a pointer to a data type that requires four bytes is declared, the compiler knows that the target object is four bytes in size. When the program then performs a calculation to offset the pointer, such as to add 3 (for instance) to the pointer, the generated code actually adds 12. This is because the compiler assumes that adding or subtracting numbers to or from a pointer is an attempt to use the pointer in an array context. (Actually, this behavior is defined in the language specification.)The other valid arithmetic manipulation of a pointer is subtraction of two pointers to the same type of object. In this case, again, an internal multiplier of 4 is applied, and the result is an offset that could be used if the first pointer were the base of an array of those objects.The size of the target object could be any value, such as a double which might be 8 bytes. The compiler will do the arithmetic correctly.Also, keep in mind the distinction between the size of the pointer and the size of the object to which the pointer points. This answer assumes the latter.In any case, the programmer must insure that the calculation results in a pointer or offset value that represents an address in the base object array, assuming that the allocated space of that object is correct. Any other result is inconsistent with the defined usage of a pointer, and the result of dereferencing such an inconsistent pointer or offset is undefined by the language specification, and could result in corruption, incorrect behavior, or crash.

Related Questions

Which of the correct way of declaring the float pointer?

float *pointer;


What is declaring pointer variable?

I'll give you an example: char *s;


What happens if we use an integer pointer as a member of structure instead of structure pointer?

By declaring an integer pointer you are declaring that any non-zero reference stored in the pointer is guaranteed to be an integer reference. In order to guarantee the reference is actually a structure, the pointer must be declared as such, because casting an integer to a structure can never be regarded as being type-safe.


Is there any memory wastage for declaring a pointer variable?

No, unless you do not use it at all.


What is a structure pointer?

A pointer is a variable that holds address information. For example, in C++, say you have a Car class and another class that can access Car. Then, declaring Car *car1 =new Car() creates a pointer to a Car object.. The variable "car1" holds an address location.


Who made the first four pointer?

"Dizzy" of the Harlem Globetrotters


What is pointer to a structure?

A pointer is a variable that holds address information. For example, in C++, say you have a Car class and another class that can access Car. Then, declaring Car *car1 =new Car() creates a pointer to a Car object.. The variable "car1" holds an address location.


How do you reset a bey pointer?

To reset a Beyblade Bey Pointer, you typically need to disassemble the Bey Pointer from your Beyblade launcher and then reassemble it properly. Make sure to align all the parts correctly and securely to ensure it functions correctly. If the problem persists, you may need to clean the Bey Pointer and check for any damaged parts that may need replacement.


What is a fat pointer?

It is 'flat', and it means unstructured, i.e. it has no segment and offset parts.


What shape must a pointer be in order to move shape?

four headed arrrow


What are the names of the parts on balance scale?

The parts of a balance scale include the beam, the pointer, the pivot point, the pan, and the base. The beam is the horizontal bar where the pans are attached, the pivot point is the central point where the beam rotates, and the pointer indicates balance.


What are the four parts of vision statement?

According to Collins and Porras, a vision statement should have four parts. What are those four parts?