Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

19: Pass by reference: Arrays#3 - Tim Lambert UNSW

Loading...

Sign in or sign up now!
6,654
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 18, 2008

Tim explains pass by reference and the link between arrays and pointers.

Using sample code we see that C passes arrays into functions *by reference*, unlike all the other types we have seen so far.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • @fum2006 This works but it is contra intuitive, so i wouldn't use it unless you want to code something that is difficult to understand, or you need to show off OR you really need those 4/8 bytes of memory. But cool trick, Richard Buckland would say it is hackerish ^^.

  • should teach them about const early!

  • An aside - to swap ints without using a temp:

    a=b-a

    b=b-a

    a=b+a

  • *(30:27) "That's C we got to live with it". C is a fools game rethink to D#++ using Pimp OS.

  • best explaintion of the use of pointers is definetly the swap idea.

    Otherwise I know how to use pointers but no idea when I have to use em.. thanks for this..

    still confused with the scanf.. since it returns 1 char why couldnt it work like getchar? bad coding when C programming was being coded? some drunken coder or what

    Maybe the scanf supports multiple inputs i havent yet seen.. example of it.

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more