CS50 Lesson 4- pointers notes part 1

Even you type in the same stuffs, the result would be still different! → you are comparing the ADDRESS instead of the value inside
if you are making *t = s, it means you are putting the address of s into t, then they would be pointing at the same address
if there are no spaces that computer can assign to you, better quit
it works perfectly now!!!!! (PS you might want to check the error if user didn’t enter anything)
What will you expect it printing out?
Why it does not work?
Why it is not 2, 1 in x,y? → you may check on the array in tutorial 2
The variables are copied into the other function
It only swap in the swap function and then released into garbage value.
I think line 21 would be the hardest to understand
Importance of base case(using if loop) to stop, or else easily get an stack overflow

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store