I am loving these c++ videos. Everytime you post them I take out my phone and the c++ ide on it and I follow along with it. It's very interesting stuff. I honestly look forward to every new one that comes out. Keep it up. And keep them coming!!!
The error at 11:13 isn't because "NULL" is a special type, NULL is just a macro that is usually defined to be 0, you get the error because a non-constant reference cannot be initialized with an rvalue (a literal 0 in this case). For example the following will compile: bool const &x = NULL; // same as bool const &x = 0; Also, what you talked about in this video is technically called "lvalue reference" (there are also rvalue references)
C++ is a language that needs to be clarify when is being taught, so THANKS for doing that! This language is awesome and extremely powerful, but the internet made of it a Swiss knife
Tim considering I only see these videos go into 20 something, and this one is 3 years old.. I hope you still make these videos in a different album or something. You are such a great teacher, or at least for me. The way you helped visualize this in my brain with your words made it so simple to understand. When my professor went over references I was so lost. But picturing the boxes really helped me understand basically immediately.
Great videos Tim. Very well thought with easy to follow and intuitive examples :) I've come from python and just starting to learn C++. I've watched all the videos in this series so far, love your simple and consise training style, especially how you demonstrate what *doesn't* work and why you might get error messages etc. Personally I find this incredibly valuable - I often find there is nothing better than being aware of the *incorrect* practice to reinforce what is *correct* . If you can apply your simple and intuitive approach all the way through to classes, inheritance, vectors, memory management, architecture etc, I think you'll be on to a winning series :)
Dear Tim can you show us please how to make basic system programs with C++ because students believe that learning C++ in 2021 waste of time and it's only good for solving "competitive programming" tasks and game development. Thanks!
this is useful you can make an reference to an object of the class as one of the parameters of function and then in the function you change the object's variables cool stuff
Makes sense on onlime games where you example have a sharing money with your teammate and when you use the money, it decreases both of yours. Other than that never heard that useless function.
Well, in an online game, each player would have their own copy of the game running on their system, and changes would be made be sending network traffic. References are just a way to directly access something. I don't yet understand everything. All I know is that I tried to write a program once, and I used SDL2 for loading my graphics. I needed references and pointers to access the images from memory.
When you have a form for a client to fill out s/he needs to have a label other than 'a' such as &name. Then we I go to use the variable name elsewhere I am using the correct information.
Note: the references in this video are lvalue references. You can also define rvalue references. The difference is basicly that lvalue references are for lvalues and rvalue references are for rvalues. Also NULL is a macro from c and should not be used anymore. With pointers you can use nullptr instead. Lvalue reference: int a = 3 int &b = a; Rvalue reference: int &&a = 3;
So I’ve noticed that conventionally, it is written as ‘type& var’ vs ‘type &var’. I know they’re both exactly the same and it doesn’t matter but is there a reason why the former style is more preferred?
I remember hearing this said a lot, but the two languages diverged. C++ is a superset of C89, but C99 and newer standards are not compatible with C++. That said, the most common compilers do support both languages.
We just learned about references yesterday in class. So timely...thanks Tim
I am loving these c++ videos. Everytime you post them I take out my phone and the c++ ide on it and I follow along with it. It's very interesting stuff. I honestly look forward to every new one that comes out. Keep it up. And keep them coming!!!
The error at 11:13 isn't because "NULL" is a special type, NULL is just a macro that is usually defined to be 0, you get the error because a non-constant reference cannot be initialized with an rvalue (a literal 0 in this case).
For example the following will compile:
bool const &x = NULL; // same as bool const &x = 0;
Also, what you talked about in this video is technically called "lvalue reference" (there are also rvalue references)
@Kobe Shepard yup, I have been using InstaFlixxer for since november myself =)
totally not a bunch of bots
Yep... A totally normal human, non-robotic conversation. Nothing special
Make sure to report so we get rid of them
C++ is a language that needs to be clarify when is being taught, so THANKS for doing that! This language is awesome and extremely powerful, but the internet made of it a Swiss knife
Tim considering I only see these videos go into 20 something, and this one is 3 years old.. I hope you still make these videos in a different album or something. You are such a great teacher, or at least for me. The way you helped visualize this in my brain with your words made it so simple to understand. When my professor went over references I was so lost. But picturing the boxes really helped me understand basically immediately.
Great videos Tim. Very well thought with easy to follow and intuitive examples :) I've come from python and just starting to learn C++. I've watched all the videos in this series so far, love your simple and consise training style, especially how you demonstrate what *doesn't* work and why you might get error messages etc. Personally I find this incredibly valuable - I often find there is nothing better than being aware of the *incorrect* practice to reinforce what is *correct* . If you can apply your simple and intuitive approach all the way through to classes, inheritance, vectors, memory management, architecture etc, I think you'll be on to a winning series :)
Dear Tim can you show us please how to make basic system programs with C++ because students believe that learning C++ in 2021 waste of time and it's only good for solving "competitive programming" tasks and game development. Thanks!
It's definitely not a waste of time.
this is useful you can make an reference to an object of the class as one of the parameters of function and then in the function you change the object's variables
cool stuff
Thank you, this made me finally understand :D
4th, I have been waiting for pointers, referrences and vectors for sooo long
Very great simple lesson
Thanks
Hello . Thank you
yessssssir
it is like entanglement in quantum physics! &b=a :)
nice hoodie tim
Makes sense on onlime games where you example have a sharing money with your teammate and when you use the money, it decreases both of yours. Other than that never heard that useless function.
Well, in an online game, each player would have their own copy of the game running on their system, and changes would be made be sending network traffic. References are just a way to directly access something. I don't yet understand everything. All I know is that I tried to write a program once, and I used SDL2 for loading my graphics. I needed references and pointers to access the images from memory.
What's the topic of the last c++ tutorial is going to be, I mean are you going to make as much tutorials in c++ as you have made in python
A big up from Ghana Africa
When you have a form for a client to fill out s/he needs to have a label other than 'a' such as &name. Then we I go to use the variable name elsewhere I am using the correct information.
we will learn about the vector and list library
i think we will cover memory allocation soon either with malloc or new?
Note: the references in this video are lvalue references.
You can also define rvalue references.
The difference is basicly that lvalue references are for lvalues and rvalue references are for rvalues.
Also NULL is a macro from c and should not be used anymore. With pointers you can use nullptr instead.
Lvalue reference:
int a = 3
int &b = a;
Rvalue reference:
int &&a = 3;
Yes!
So I’ve noticed that conventionally, it is written as ‘type& var’ vs ‘type &var’. I know they’re both exactly the same and it doesn’t matter but is there a reason why the former style is more preferred?
the reference converts it to a pointer that is just the address
Alright the lesson makes sense but I don't see any conditions in which this would really be useful
please make a course for data structures and algorithms in python
So if I have int x = 2, the statement int y = &x would store the give me a hex value?
Backend code with c++. That'd be fun.
when will you make the series with java as game develop
pointers will be the next topic c++ is actually c but a superset
I remember hearing this said a lot, but the two languages diverged. C++ is a superset of C89, but C99 and newer standards are not compatible with C++. That said, the most common compilers do support both languages.
10th I guess
3rd :) still early tho
5th 😂