944,181 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2608
  • C RSS
Feb 14th, 2006
0

Pointer arithmetic homework question

Expand Post »
This is one of my hw question and I can't find the answer from the textbook.

Question: A function that modifies an array by pointer arithmetic (e.g., ++ptr) to process every value should have a parameter that is?

a) a nonconstant pointer to nonconstant data
b) a nonconstant pointer to constant data
c) a constant pointer to nonconstant data
d) a constant pointer to constant data

My guess is either a or d but i'm not sure...any help plz!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
jack223 is offline Offline
27 posts
since Nov 2005
Feb 14th, 2006
0

Re: Pointer arithmetic homework question

The clues in the question are modify data and ++ptr. Both these need non-constants. So the only possible answer is a).
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Feb 14th, 2006
0

Re: Pointer arithmetic homework question

Thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
jack223 is offline Offline
27 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: HID Input
Next Thread in C Forum Timeline: c and shared libs ?? how to do it right?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC