@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 ^^.
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.
@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 ^^.
Julien1345 7 months ago in playlist COMP1917 Higher Computing - Richard Buckland UNSW
should teach them about const early!
spitball123 1 year ago
An aside - to swap ints without using a temp:
a=b-a
b=b-a
a=b+a
fum2006 2 years ago
*(30:27) "That's C we got to live with it". C is a fools game rethink to D#++ using Pimp OS.
ad2181 2 years ago
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.
sspoke 3 years ago