Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Pointers Part 2: Didn't we passed by address rather than reference by the end of the video?

During the Pointer Part Video of the 'Beyond the Basics' stage of the Objective C class, correct me if I'm wrong (it's been a while since I've done C instead of Objective-C), but isn't the function at the conclusion of the video more of an implementation of a function that demonstrates passing arguments by address its parameters?

We then deferenced the pointer to get to the value(s), correct?

Perhaps I was interpreting things wrongs but it seems by the end of the video the functions was referred to a function demonstrating a passing arguments by reference pattern, which I'm more familiar being a function that uses & for its parameters instead and changes automatically the same-named variable within the scope of the function. .

2 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

I think you are thinking of C++. In C, Pass-by-reference you pass the address of a variable (a pointer) and dereference that address within the function to read or write the actual variable.

Ahh, that makes sense. Thanks for the clarification.

Edit: What happened to the best answer/question answered options?