answersLogoWhite

0


Best Answer

Multiplication is yet another thing, what you should never do with pointers.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does multiplying a pointer by 5 in C plus plus mean How does it change the pointer's value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an array of pointers to pointers?

A pointer is a variable that stores value of address of a variable. Since a pointer itself is a variable, it is allocated a memory location.Pointer to pointer means a pointer which points to the address of a pointer. In other words a pointer to a pointer has the address of the address of a variable.We can have pointers to int, and pointers to char, and pointers to any structures we've defined, and in fact pointers to any type in C, it shouldn't come as too much of a surprise that we can have pointers to other pointers. If we're used to thinking about simple pointers, and to keeping clear in our minds the distinction between the pointer itself and what it points to, we should be able to think about pointers to pointers, too, although we'll now have to distinguish between the pointer, what it points to, and what the pointer that it points to points.


Why use pointer?

Because you can produce fast and efficient code. Function arguments are passed "by value", and so you can't change the original value of the argument, but if you use pointers, you can.


Difference between void pointer and null pointer?

A Null pointer has the value 0. void pointer is a generic pointer introduced by ANSI. Before ANSI, char pointers are used as generic pointer. Generic pointer can hold the address of any data type. Pointers point to a memory address, and data can be stored at that address.


What is the uses of call by value in c?

You pass by value when you do not want the original value to change and the value being passed is no more than 4 bytes long (or 8 bytes on a 64-bit system). If the value is greater than 4 bytes, you will incur a copy overhead, which can be expensive if the value is an array or other complex structure or object. If the value is passed as a const, the function will not alter its copy of the value. If the value is passed as non-const, the function can alter its copy of the value. Either way, the original value is unaffected. Pointers are always passed by value. That is, the pointer is copied by the function, leaving the original pointer unaffected. However, since the copied pointer points to the same memory as the original pointer, it's as if you had passed a reference to that memory, without copying that memory. If the pointer is passed as a const, the immutable members of the memory being pointed at will be unaffected by the function call. If it is non-const, it is expected that the memory being pointed at will be changed by the function call. If you do not wish the original memory to be altered, you must copy that memory and pass a pointer to the copy instead. Naturally, this will incur a performance penalty. Passing by reference passes the actual value being referenced, without copying. However, the compiler implements references as pointers so the same rules apply as for pointers. If the reference is non-const and you do not wish the value to be altered, copy the value and pass a reference to the copy instead. Passing a pointer by reference, rather than by value, is achieved by passing a pointer to the pointer, rather than a copy of the pointer. This allows the function to change the value of the original pointer. That is, the original pointer can be altered by the function to point at another memory location. When dealing with dynamic, multi-dimensional arrays, pointers to pointers (to pointers!) are fairly common, if only to avoid the costly copy overhead.


What is the difference between the Constant pointer and pointer constant and explain it with an example?

Pointer to constant *ptr=10 statement is invalid in pointer to constant i.e assigning value is illegal ptr++ statement is valid in pointer to constant. pointer can be incremented and decremented, Pointer is pointing to constant data object. Declaration: const int *ptr; Constant pointers: *ptr= 10 is absolutely valid in constant pointers i.e assigning value is perfectly legal ptr+++ statement is invalid in constant pointers. pointer can not be incremented or decremented. Declaration; int *const ptr;


What does it mean by huge pointer is normalize give detail about far pointer huge pointer?

On far pointers the comparison operators(== and !=) check the 32 bit value. While >, =,


Array of pointers?

a pointer is a variable that contains memory location of another variable.the value u assign to the pointers are memory address of other variable.


Why are pointers needed in C programming?

pointer is used when we want to retain the change in values between the function calls. Similarly double pointer is used when we want to retain the change in pointers between the function calls. If you want to modify pointers than you need double pointer to retain the change.


How do you scan values in pointers of C programming?

You do not. A pointer is an opaque value that you do not care what its internal bit value is. You only care that it points to a region of memory that you can do something with. You can scan that region of memory, but not the pointer itself.


What is pointer and pointer types and uses of pointer and the meaning of pointer?

The main advantages of using pointers are 1.) Function cannot return more than one value. But when the same function can modify many pointer variables and function as if it is returning more than one variable. 2.) In the case of arrays, we can decide the size of the array at runtime by allocating the necessary space. C has a minimum number of fundamental data types - a single character, a single integer or float, and a few derived data types such as a structure, an enumerated list, and an array. If you want to do much more than that, you make use of pointers. Pointers allow you to dynamically request memory to store off information for use later. They allow you to create linked lists and other algorithmically oriented data structures.


How many pointers can be used in a c program?

Answergenerally we use simple pointer, void pointer,null pointer, structure pointer. Answerzero or more (unlimited).


Different types of pointers in c language?

... are usable. void pointer (generic pointer) : a special type of pointer which point to some data of no specific types. void *p; null pointer : a special type of pointer which point nowhere. it is usually used to check if a pointer is pointing to a null or free the pointer during deallocation of memory in dynamic memory allocation; it is define by using the predefine constant NULL int *p=NULL; wild pointer : uninitialized pointer. it hold a garbage value. i.e it is not pointing to any memory location yet. dangling pointer: pointer pointing to a destroyed variable. it usually happen during dynamic memory allocation when the object is destroyed but not free and the pointer is still pointing to the destroy object.