Engineering Science 1036A/B Lecture 20: Pointers: Pointer Arithmetic

19 views2 pages
Arithmetic Operators
4 arithmetic operations are supported
+,-,++,--
Only integers can be used in these operations
2 pointers can be subtracted from each other but can not be added to
each other
Arithmetic operations is performed relative to the base type of the variable (int,
double)
++: increment pointer to point to the next object
--: decrement pointer to point to the previous object
Assignment/Equivalent Operators
Both assignment and equivalent operators can be used with pointer variables
Example
Practice pointers problem
Pointer Arithmetic
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents