answersLogoWhite

0


Best Answer

You do not multiply pointers. If you want to multiply the values that they point to you must dereference them, usually with a *

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to multiply two int pointer variable in C language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is pointer initialization?

Assigning an initial value to a pointer variable. Example: int *p= NULL;


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.


What is the difference between pointer before a variable and pointer after a variable?

I presume you referring to the C pointer syntax where an asterisk operator may be suffixed to a type or prefixed to a variable. The following may help to clarify: int*p; int* q; int *r; int * s; All four of these declarations are exactly the same (they are all pointer-to-int variables). Note that the physical position of the asterisk operator makes no difference whatsoever, no matter how much whitespace you use (whitespace is essentially ignored both before and after an operator). Because the type is pointer-to-int, it usually makes sense to use the second variant to separate the variable's type from its name. However, this doesn't really work when declaring multiple pointer variables of the same type on the same line using the comma operator. Consider the following: int* p, q, r, s; While it is natural to assume p, q, r and s are all pointer-to-int types, they are not. The first, p, is the only pointer-to-int type, while all the others are just plain int types. If we really want 4 pointer-to-int types, we need to use the following declaration instead: int *p, *q, *r, *s;


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


C program pointers to pointers examples?

Pointer to Pointer is a double pointer, denoted by (**). Pointer stores the address of the variable and pointer to pointer stores the address of a pointer variable and syntax can be given as int **ptr2ptr;

Related questions

How do you declare a pointer variable in c?

int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.


What is pointer initialization?

Assigning an initial value to a pointer variable. Example: int *p= NULL;


Define pointer to pointer in c?

Double (**) is used to denote the double pointer. As we know the pointer stores the address of variable, Double pointer stores the address of any pointer variable. Declaration : int **ptr2Ptr;


Can you make an integer pointer variable to char data?

Of course. But why? int *p = (int *)"string";


How do you declared and initialized a pointer variable?

#include<iostream> int main() { int x=42; int* p=&x; // declare and initialise a pointer, assigning the address of x. }


Why only three types of pointer variable in c language?

I have no idea what you mean by that... Some examples for pointers of different types: int *intptr; char *charptr; void *generic_ptr; FILE *stdin; int (*funptr)(int, char **);


What is the difference between pointer variable and simple variable What are the advantages of pointer variable?

normal variable stores a value of the given datatype where as the pointer variable stores the address of a variable. for example int n=10; int *p; p=&n; here p is a pointer variable and n is a normal variable.p stores the address of n where as n stores an integer value. *p prints the value of n,p prints the address of n.


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.


Int a is literal in C language or not?

int a; -- variable definition"int a" -- string literal


What is the by default value of globally declaration variable?

int, float: 0 pointer: NULL


What is the difference between pointer before a variable and pointer after a variable?

I presume you referring to the C pointer syntax where an asterisk operator may be suffixed to a type or prefixed to a variable. The following may help to clarify: int*p; int* q; int *r; int * s; All four of these declarations are exactly the same (they are all pointer-to-int variables). Note that the physical position of the asterisk operator makes no difference whatsoever, no matter how much whitespace you use (whitespace is essentially ignored both before and after an operator). Because the type is pointer-to-int, it usually makes sense to use the second variant to separate the variable's type from its name. However, this doesn't really work when declaring multiple pointer variables of the same type on the same line using the comma operator. Consider the following: int* p, q, r, s; While it is natural to assume p, q, r and s are all pointer-to-int types, they are not. The first, p, is the only pointer-to-int type, while all the others are just plain int types. If we really want 4 pointer-to-int types, we need to use the following declaration instead: int *p, *q, *r, *s;


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