Exforsys

Online Training

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 ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-04-2007, 06:04 PM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2007, 03:32 PM
Senior Member
 
Join Date: Apr 2006
Posts: 122
rachelle is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2007, 05:31 PM
Senior Member
 
Join Date: Apr 2006
Posts: 144
caradoc is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 12:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.