0

01. ) during sorting , if we wish to swap the items in 2 positions , we simply swap the pointer values and leave the main data table unchanged:: what is a possible advantage and disadvantage of doing this .. ??

02. ) what would be the effect of incrementing a pointer to int
and increamenting a pointer to double

03. ) what would be the effect of changing the line (*p)++; to *p++; ??

04. ) what are the difference between stack allocation and heap allocation ??

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Abzero
1

Homework questions?

If you have a specific question; show your working and we can clear up any mis-understandings. Posting just questions won't get answers.

Votes + Comments
Bravo, well said!
0

Every question has workings; but not always code workings.

Some nudging into the right direction here:

01. ) If you imagine what you do with a non-pointer sorting. When you swap an item what do you do? How would performance be affected if the items were 'chars'; how would the performance be affected if the items were 1Gb arrays? What is the cost of a pointer swap?

02. ) In general what does incrementing a pointer mean?

03. ) This is an operator precedence question, each is parsed differently; bracket each one according to the operator table and the answer should pop out.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.