Computer Science Canada pointer output confusion |
Author: | unoho [ Tue Apr 27, 2010 10:33 pm ] | ||
Post subject: | pointer output confusion | ||
output is: Niagara Falls Port Dover Long Point port burwell pelee island could anyone please explain the output to me. im kinda lost,, maybe im overthinking thanks |
Author: | TerranceN [ Wed Apr 28, 2010 3:03 pm ] |
Post subject: | RE:pointer output confusion |
At the start of the program: ptr goes to NULL Long Point goes to NULL Niagara Falls goes to NULL Pelee Island goes to NULL Port Burwell goes to NULL Port Dover goes to NULL After you change ptr and next values: ptr goes to Niagara Falls Long Point goes to Port Burwell Niagara Falls goes to Port Dover Pelee Island goes to NULL Port Burwell goes to Pelee Island Port Dover goes to Long Point Now just follow from ptr until NULL. In case you didn't know this, what you are creating is called a linked list. Hope that helps. |
Author: | unoho [ Wed Apr 28, 2010 4:10 pm ] |
Post subject: | RE:pointer output confusion |
oh,, I already got it but thanks for your answer... I just had to look up some notes on pointers,, thnks again |