I love your lessons! Сan you make a video on how to create a binary like "BMP" with file header.
@PortfolioCourses2 жыл бұрын
Thank you. I will add this to the list of video requests. :-)
@thee3a2 жыл бұрын
Super clear explanations. Thank you!!
@PortfolioCourses2 жыл бұрын
You're welcome Thea! 😀
@EsraUn-hf9zt3 ай бұрын
I wish there were Turkish subtitles :(
@korngsamnang2 жыл бұрын
I feel so hard to understand pointer concept.i didn't clearly about that since i've learned c/c++.
@PortfolioCourses2 жыл бұрын
I think pointers are one of the hardest things to learn in C/C++ Korng! Maybe this video will help you out: kzbin.info/www/bejne/aHinmot9areZhKc. 🙂
@hodayfa000h3 ай бұрын
I would say the main issue with pointers the fact they didn't work with them, for example i used to use cheat engine and that really helped me grasp pointers and assembly@@PortfolioCourses
@weakbit6334 ай бұрын
ones I run clear the g++ to compile it and now at the 3rd compilation I get this? [error: cannot convert ‘double*’ to ‘double’ in assignment 12 | number = (double *) malloc(sizeof(double));] - did you see any issues here in my line? Thank you first run all go but during the Video I enter 3lines more and then... :-( Thank you for this Video I'm a beginner in C++ I found the failure! private: double *number; //here I loose the * and then this Error occur
@snowandl41952 жыл бұрын
Hello , I am using Visual Studio 2022 And when I type like your code 02:00 The Destructor does not activate!! But it becomes like a function being called by the object , Is it because of the Compiler or a new language update ? Or is there something wrong ?
@snowandl41952 жыл бұрын
Sorry to bother you, I was using this code at the bottom of the main() function. system("pause>0");
@PortfolioCourses2 жыл бұрын
@@snowandl4195 OK, so it sounds like you solved the issue on your own? Or is it still an issue? The code for this example is here, it should work: github.com/portfoliocourses/cplusplus-example-code/blob/main/destructor_basics.cpp
@snowandl41952 жыл бұрын
@@PortfolioCourses Yes, I solved the problem, and this code is system("pause>0"); It is the cause of the problem
@ayoubmounadi2142 Жыл бұрын
Awesome video. Thank you so much 🙏
@PortfolioCourses Жыл бұрын
You’re welcome Ayoub, I’m glad you enjoyed it! :-)
@maulikshah91223 ай бұрын
Is is good to use delete operator inside the destructor?
@PortfolioCourses3 ай бұрын
Sometimes we really should in order to “clean up” things that the object is responsible for cleaning up. Like if you delete a Person object and a Hand object is created and “owned” by that Person object from initialization until deletion then the Person object should delete it, for example.
@maulikshah91223 ай бұрын
@@PortfolioCoursesOkay, Got it! Btw Your content is just mind blowing!🔥Keep sharing knowledge with begginers like us!
@ieduardoms Жыл бұрын
Thanks for providing the source code, this way we can open the source code and don't need to go back and forward in the video.
@PortfolioCourses Жыл бұрын
You're welcome Eduardo! :-)
@chenchen-eo4yf8 ай бұрын
Hey, all great tutorial videos out there, thx! I want to ask that some videos are covered in C but not in C++, might due to the reason C++ tutorial is not done, so could I use those "missing" videos in C to cover the same concept in C++?like pointer, dynamic allocation, etc. Cause Im taking C++ course rn.
@PortfolioCourses8 ай бұрын
For the most part.... yes. C++ basically maintains compatibility with C for the most part. So if a program works in C, it will work in C++. But this is only "mostly" true, there are some small differences and exceptions here and there too. e.g. in C we can have: int *data = malloc(sizeof(int) * 50); but in C++ we need to have: int *data = (int) malloc(sizeof(int) * 50);
@PortfolioCourses8 ай бұрын
Also, is that the horse from Horsin' Around?
@chenchen-eo4yf8 ай бұрын
hahh I hear the voice. love the interaction. thank u@@PortfolioCourses
@korngsamnang2 жыл бұрын
Hey professor, it's look like many different ways made Destructor called. So when exactly is Destructor called? Or how many ways to make Destructor called? When an object goes out of the scope, when the program end, or when delete operator is called? I'm so confused right now.
@PortfolioCourses2 жыл бұрын
It's definitely confusing, but yes, you're correct, those are the 3 main ways that a destructor is called: when the program terminates, when the scope containing the object ends, and when the delete operator is called. There are some other ways that a destructor can be called, for example if we are using inheritance in our program, that is covered in those videos. 🙂
@korngsamnang2 жыл бұрын
@@PortfolioCourses thank you i got it😊
@PortfolioCourses2 жыл бұрын
@@korngsamnang You're welcome! 😀
@michellevan5693 Жыл бұрын
@@PortfolioCourses Hi just reading the commnets- just another question - i understand that there are 3 main ways, how do you choose when do call the delete operator? Also, from what I understand, there is an implicit destructor in the class even if we don't write it, so if thats the case, when do we write one and when do we not?
@tomitomi7941 Жыл бұрын
Sir your tutorials are so helpful. Thank you a lot.
@PortfolioCourses Жыл бұрын
You're very welcome Tomi, I'm glad you find them helpful! :-)
@tekkel062 жыл бұрын
Great content ! Keep on the great work !
@PortfolioCourses2 жыл бұрын
Thank you! :-D
@Vichained2 жыл бұрын
great video once again
@PortfolioCourses2 жыл бұрын
Thank you again Victor! :-D
@adelmae9037 Жыл бұрын
simple and to the point explanation thank you
@PortfolioCourses Жыл бұрын
You’re welcome! :-)
@cd-stephen Жыл бұрын
great vid
@PortfolioCourses Жыл бұрын
Thank you! :-)
@jonjones62182 жыл бұрын
Nice
@PortfolioCourses2 жыл бұрын
Thank you! :-)
@jonjones62182 жыл бұрын
@@PortfolioCourses no problem man,i learn a lot from u
@mytech67792 жыл бұрын
Using malloc and free inside of a C++ class in 2022 is a very edgy style choice. "That's a bold strategy cotton!"
@PortfolioCourses2 жыл бұрын
For a basic double array it won't matter, but I suppose new learners watching this video might not know that or what malloc is either... maybe one day I'll make another destructor video using new instead.
@mytech67792 жыл бұрын
@@PortfolioCourses Its not too hard to understand what it is doing, I just found it a wild contrast of the old C style and modern C++ tools. Though if going modern in a new video you should probably should just skip right to a unique_ptr or make_unique; new and delete have been superseded for over a decade [but yes they are still popular in the wild]
@PortfolioCourses2 жыл бұрын
Smart pointers are pretty neat and something I want to cover as well. I’m not a big fan of how many ways it’s possible to do things in C++, I’ve come to prefer more opinionated languages and technologies like Python over the years.
@mytech67792 жыл бұрын
@@PortfolioCourses The wide number of options is just a natural outcome of maintaining decades of backward compatibility. However most of those other options are essentially deprecated and only exist for that backward compatibility and occasionally some niche boilerplate use cases. That is, combining "C with Classes" features with C++20 features is technically possible but not the intended use; it would be like mixing Python 1, 2, 3, and cython into a mutant program. (If Python had backward compatibility.) The example here of dynamic allocation, the Core C++ guidelines that accompany the standard, consider new, and delete as completely outdated, with smart pointers being a zero overhead replacement everywhere except in the writing of the smart pointers. (They are implemented as library class templates, not core built ins.) Malloc and Free are not part of C++, they are C, isoC++ just happens to adopt most of IsoC for compatibility. (There are a couple C keywords that are not in a C++ compiler, and a few that emulate C but are different down deep.) So while C++ is permissive for those that need it to be, it is also quite opinionated.
@PortfolioCourses2 жыл бұрын
@@mytech6779 I prefer opinionated technologies that are not permissive. I've never heard the term opinionated applied to a technology that is also permissive, that's interesting that a technology could be both at the same time. My issue with things being "essentially" deprecated is that we know people will use them anyways, whether they should or shouldn't.