I searched all over for a good explanation of references and pointers and nobody came close to explaining them as clearly as you do. Thanks for the video.
Haven't written in C or C++ in 30 years, and suddenly I found something I wanted to do that required C++. So, your lighthearted and straightforward tutorials are a godsend.
I think you should mention that pass by value will not only consume memory, but also copy operation can be time consuming. Yes this is premature optimisation. But nothing wrong with mentioning that creating new variable/object and copying data not always cheap operation.
He goes over that in the video preceding this one. He does a really good conceptual overview of references in that video, and this video is kind of just a hands-on implementation video.
Hey Caleb. Great Video. Question. Why does passing a function parameter by reference give a different answer to passing it by value. What is the reasoning here? Thanks in advance
It is because when passing a value of the function work, we copy the value of a to x and then increment x. Since we copied a to x and only x was incremented, this means the value of a is the same since it was not put through the function at all. When we set x as a reference instead, it means a and x share a value instead. So now x is being incremented by the function work, which also affects a now since they are referring to one another. That's why the value was different when he used the reference.
@Artem Katerynych Thanks for the information, i tried to install SFML once but the problem is, i dont know how to install third-party libraries. Can you please explain how i install them?
Extremely knowledgeable and genuinely cares about the success of his . Over all my sessions with Sir Scott Wilson ,I’ve come to conclude he has the best win ratio of 95+ and his sincerity is something you won’t find anywhere. Great place to earn and be supported by successful seasoned traders.