
- Forum
- Programming Talk
- C and C++
- Operations with Pointers
Operations with Pointers
This is a discussion on Operations with Pointers within the C and C++ forums, part of the Programming Talk category; I want to know whether all arithmetic operations are allowed with pointer variables. If not what are the operations that ...
-
Operations with Pointers
I want to know whether all arithmetic operations are allowed with pointer variables. If not what are the operations that are allowed and not allowed. Kindly provide the list.
-
The allowed operations on Pointers are:
Assignment to other pointers of the same type
Addition and subtraction of a pointer to an integer
Assignment of the value 0
Comparison to the value 0
Other than the above operations other operations are not allowed with pointers.
-
To explain you in brief I have given below some examples on operations that are not allowed with pointers.
Multiplication or division on a pointer
Addition or subtraction of two pointer values
Assignment of a value other than 0 to a pointer
-
Sponsored Ads

Reply With Quote





