Pointer trouble !
Oct 31, 2013 at 3:48am UTC
I am having some trouble with this pointer problem ! I cannot figure out how we find the input. I don't have trouble with basic pointers, but this question is beyond me.
Here is the link to the problem:
http://i40.tinypic.com/24d4xso.png
Could someone please explain to me why the output is 0112 ? Thanks :)
Oct 31, 2013 at 4:22am UTC
sportguy98 wrote:I cannot figure out how we find the input.
There is no input in the linked program.
Oct 31, 2013 at 5:31am UTC
Iteration 1:
I = 0, j = 0, k = 0.
Hence output - 0. (2nd cout)
Iteration 2:
I = 1, j = 0, k = 1.
Hence output - 1. (1st cout)
Iteration 3:
I = 2, j = 1, k = 1.
Hence output - 1. (2nd cout)
Iteration 4:
I = 3, j = 1, k = 2.
Hence output - 2. (1st cout)
Topic archived. No new replies allowed.