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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-15-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:01 AM |
| comp.lang.c FAQ list Table of Contents | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 05-15-2004 07:00 AM |