I was at school when pocket calculators first appeared. Now 65, sitting here on a Saturday morning, learning c++ from a young man who's worked in the games industry. Amazing what is possible on the internet. I remember when the only hope you had of learning this kind of thing was getting hold of a good book (and that was when libraries closed early on Saturday and were closed on Sunday) Many Thanks for sharing your knowledge.
When I was in school smartphones came along, The knowledge of the world in the palm of your hand! I bet when I'm 65 We'll have room temperature quantum computers in our homes
Damn dude, it's insane to see how you've gone from doing some low quality code rambling to neat, organized and well edited professional tutorials, and from a couple hundred to over 50k subscribers! Great job man, you've helped me tons in the past, keep doing what you're doing!
What'd you expect, he's not an armature. He's a pro! Don't forget it. And it is Mr. Dude. Get it right! "Respecto, holmes. You have to give it, to get it."
Douchbag alert! James R, take your own advice, you pretentious asshole! The guy was just giving a compliment. The way you tell people what they should have said, you might as well just write everybody’s comments for them so you approve.
I have watched manu C++ tutotials on youtube in my professional career and I have never come across anyone who can do such a great job at breaking down complicated concepts into a very concise and easy to follow short lectures. You helped me to really understand how this stuff works. I wish that my university professors who taught/teach programming had half of teaching talent you have. Thank you!
@@mrreflecting4691 I said "wwwwwwwwhhhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
Wow dude... just wow. I was about 12 or 13 when I first heard of C++... I had found out that its used for video games which instantly struck my interest... but it wasnt until I was about 16 or 17 that I started dabbling in it and I thought it was too difficult for me to understand, and I thought you had to be extremely smart.. I am now 19... and have no idea where my life is going, I have always LOVED the idea of writing my own code, because its the closest thing to actual magic.. I’ve recently started trying to understand the concepts of c++ and how it all works.. I have a basic understanding of it all, and I really really wanna learn it. I’m going to go to college to get a BA in computer science. Whether I help make the next AAA title, or the next microsoft... I just want to code.. I’m very entrepreneurial as well so I don’t see myself working for someone This is the first tutorial of yours that I’ve seen, and you made me understand the most basic c++ program even more than before. I’m looking forward to watching the rest of this series and I hope you continue it.
im 19 too and i feel like we twins because everything you said was like me talking about my life but i actually went for civil engineering but still wanna learn C++
I found Cherno yesterday and coming in, my thinking was that C++ was super hard core and probably beyond me at this point. I have to say, after watching this video, I understood everything. I'm not saying I'm smart, I am saying this dude is a great teacher. Clarity, repetition, efficiency of explanations. I am almost thinking C++ might be a better first language to learn than Java. I've learned the basics of Java already as part of my bachelors degree. At this point I'm on the fence about which way to go. But if the lessons are like this one, I don't see C++ being that scary hard language to learn that everyone says it is. And that would be a testament to the teacher. Great work.
I learned C++ as my first language and altough it was quite tricky to wrap your head around some of it’s concepts in the beggining, it made it really easy for me to later learn new languages such as Javascript and Python.
yea, late reply here....but Java as a first language has been considered a pretty bad idea for quite some time now. But don't get me wrong, I'm not one of those folks who thinks if you start off in the "wrong" language that you're RUINED FOREVER (!! -- seriously, some ppl think like this). Java is cool. I think the top2 languages for first timers atm would be Python (by a huge margin) or C (for the "bottom-up" approach).
Actually I think Python is best to learn first, which I luckily did. I think C++ ist more important than Java so I am actually planning on learning C++
@@intuit13 started off with C as part of my bachelor's degree. Makes it way easier to grasp C++ in my opinion. Using Python as a starting point works but the way it's written (and in some cases the way it works) is pretty different to C++. I'd recommend it as a starter but not if your final aim is learning C++.
Just wanted to say thank you. I tried coding when I was a teen but failed and quit (there was no TH-cam back then). My son is interested and I thought we could learn together. Your videos are very well explained and I really appreciate the effort that you put into you videos.
So, I am a working professional. But I had to teach a friend of mine, the basics of C++. For that, I was looking for some easy videos. Man, This guy explains so well. One thing is for sure when I get married and if I have kids and if they choose to become a Software engineer, this guy is the one I am gonna send my kids for tuitions.
Dude this is high quality stuff! I'm studying Computer Games Development at University and have learnt more from your C++ series than I have all year! Really looking forwards to digging into your OpenGL series. Thanks so much for bringing this great content man and please keep it up :D
After many tries to get into coding, I again started an approach and found your series here. Well done! As you start with the basics, it feels like it gives me the right entry point to finally understand some fundamental layers I didn't have in the past. So my hope now is, to finally get deeper into coding. Good job!
Once you are past tutorial level throw tutorials into trash and start working on your projects tutorials are going to help you with basics but after that you need to start working on your own with help of google maybe but tutorials shouldn't be part of your daily life anymore.
Your videos should have been the first thing that popped up when I searched C++ tutorial. I went through a 100 video course that skimmed over very important concepts I wish I learned sooner. You're doing a great job!
This is the best tutorial series for C++ in existence.. No seriously, this guy is the ultimate tutorial master! The way he explains things is extremely easy to follow and understand!
Finally a cpp tutorial that doesn't treat me like a dumbass, I am an intermediate coder in lua so I know a lot of programming practices and what it means, your videos are good unlike those videos who waste your time by teaching you like you never touched a computer
Wow TheChernoProject, I just currently came along this video and I must say it got my attention. Even though I like to code in C# (as a hobby in my free time, I am not any professional or something), after watching this video you really caught my interest in watching how the whole c++ thingie works and how everything in programming ties together to create an executable file. I was so hyped watching on how the linker and the compiler works, but then saw that they are coming soon and this video just came 4 days ago. However I subscribed and turned on notifications so I don't miss the next one. Keep up the good job, you're awesome! :)
Have to learn C++ for a class that the teacher does not know how to code in C++. Your videos are the only ones that aren't hours upon hours long. Cheno you are my only hope.
Omg, this is insane, years learning programming and nothing like this, well explained and makes you think about the real power of c++, DAAM! Thank you so much.
@@TeeHeeWinning I didn't... However please don't let this put you off. I didn't because I was a Python programmer and was learning C++ for the wrong reasons, and so my motivation failed me, or itself. I'm waiting until I get a project idea and then I'll learn around that. If you know one programming language well, the rest fall in line. Good luck :)
@axedow Sorry I didn't see this notification. I always wish people replied to these comments, looks like it's a TH-cam problem. See my other reply if you're still interested :). Hope you're well.
@@juleswinnfield1437 The only programming language I’m decent at is the lua version of roblox. My motivation for learning c++ is to learn how to make ESP in other games. Cuz I don’t really know what else I would do with c++. Anyways good luck with learning more languages.
@@TeeHeeWinning Funny you should say that, because I was originally learning C++ to make cheats for CS:GO. It didn't work out for me, as understanding the tricky aspects of C++ is hard, especially for a kid tryna make CS:GO cheats. People learn differently though!
I've watched so many courses on different programming languages, and they're always so boring, they don't engage me and keep my attention, but everyone of your videos have held my attention and I'm so thankful to have you as a resource.
I've been trying to learn a coding language for years. This stuff is actually making sense and I can actually make decent notes. Thank you for explaining this stuff simply.
summary: Our code gets translated into a binary, and the binary can be either a library or an executable file. x86 = win32 There are 2 main options that we can choose when building our code in visual studio. One is the platform, and one is the mode of building. Platform refers to the operating system that we are targeting our app for. It can be either android, windows, mac(?) and so on. Mode of building refers to whether we are building the executable file in debug mode or release mode. Building on release mode runs much faster than debug mode, but is less helpful when debugging. For devlopers until the release of the game, they will be using debug mode untill the project is complete. For each building mode, we can see the micro settings when we right click the project and go to settings. We also take a look at the linker settings in the same window. The output window shows all the errors, and we are expected to debug using the information provided there. We do not want to rely on the error list, since they just display what the machine can understand from the output screen, which is too superficial for actual developers. #include is something that is called a pre-processed statement, meaning that it is being compiled before our main body of code. In this case, #include means that copy and paste everything in a file named to this file. //I believe #include command is something similar to the 'import' command that is used in python to call for modules. Cherno explains that #include is copy and pasting the file into the current file, which is exactly how a module is imported in python through *import library* command. Python also runs the whole code that is in the stated library before running our main code, if we import something from a library! In a project, it is very likely that we will have multiple cpp files. Those cpp files will be converted in to an object file. These have their file extensions as obj, and can be found at certain directories. Those obj files can then be stitched together using the linker. Cherno demonstrates how to use this kind of system. He uses the common 'hello world' code. He then chooses to define a function that prints out hello world, instead of using the common cout
At 17:00 , If you're compiling this code on VS Code Editor, you might get an error saying : error : c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\ASUS\AppData\Local\Temp\ccoFOfoQ.o:main.cpp:(.text+0x16): undefined reference to `log(char const*)' collect2.exe: error: ld returned 1 exit status Reason : We are getting this error because the text editor (like VS Code) sees different files rather than seeing it as one unit (like in Visual Studio IDE) Solution : If you have two files, 1) main.cpp (includes declaration & calling of function which is situated on other file). 2) log.cpp (definition of the function which wil be used in "main.cpp") Now , use just need to add (#include "log.cpp") in the main.cpp file to include all the function defined in log.cpp at the runtime. also, try changing "#include log.cpp" to "#include log.h" (also rename "log.cpp" to "log.h"), So that the compiler wil take it as a header file. code : > main.cpp #include #include "log.cpp" void log(const char* message); int main(){ log("Hello World"); return 0; } ------------------------------------------------------------- log.cpp #include void log(const char* message){ std::cout
You are like a fresh breeze. I am a software engineer. I came here through PS5 tech demo and saw you are an X EA developer. Your teaching style is just amazing. Really liked your videos.
Dude, I just have to say THANK YOU!! I've been struggling to learn C++ on my own for a length of time which I'd rather not admit lol and sometimes books and forums just don't cut it. I've been looking for something exactly like this for so long, and here it finally is. So far I've only watched this and your video on templates, but you have a knack for explaining things in such a way that it's all finally starting to make sense to me. So again, thank you for the awesome content.
It is profound that you include how #includes are preprocessed, pun intended. This becomes very important later in the linking video. Your ability to teach what you understand is very impressive and very helpful to us that are just learning C++. You clearly understand what we need to know. Notice my grey beard; this is not my first C++ rodeo! Thanks.
I think this is the first time, I hear someone explaining as simple & understandable as possible, how compiling and linking works in cpp! really great videos!
Your background music is saving my life, thanks for making "easy to swallow" videos for average audience like me 🙏🏻 the music is making me more focused on the content, other channels without music is boring and easy to be distracted
For those who wonders what happens if you have 2 cpps files with the same methods and try to build it, the output will throw the following error: LNK2005: "void __cdecl log(char const *)" (?log@@YAXPEBD@Z) already defined in Log1.obj and: fatal error LNK1169: one or more multiply defined symbols found So your linker doesn't know what method definition it should use for the declaration on main file. Excellent video, btw! You made something complicated seems simple and that's not easy job.
Excellent video. I know C++, but I love the way you teach this -> I watch it. Can't wait to see more and getting into more advanced topics (maybe some topics like engine design, optimization or targeting multiple platforms...). When can I expect some of these topics to come (if you plan on making a video about them)? (take your time, I fully understand that you want to teach C++ from the very basics, I am just interested... ^^) Thank you for this video and keep up the good work, looking forward to the next episode. :)
I love how your videos contain epic background music. It makes your tutorials and explanations significantly more engaging than anything else I have seen on youtube.
Revisiting all these first videos months after starting learning C++ are so important and so much more informative. Now we can add all the pieces together and finally understand something. That's not possible in the beginning.
Finally, a C++ tutorial I can recommend to my students. Very well done. One minor nit: stop using std::endl. Just use ' '. ' ' does the same thing as std::endl, and doesn't have the side effect of flushing the output buffer. Normally this won't matter, but if you're writing a large file over, say, a very slow VPN, it can take forever. Besides, it's less to type.
Hail, Cherno! Woo! I now have VS 2017. I certainly have been enjoying VS 2015. VS 2017 looks way better and is way cooler. I love your video style, the quick short talks with cuts and the music. (5/5)
Small caveat, the computer doesn't start running main right away. There is a bunch of code that c++ inserts before the call to main to set some things up and then it calls main. Same thing happens once main terminates. There is some code c++ inserts to restore state and put the return value in a register
If you need two different log functions that have the same parameters, you need to either rename the function, or use a namespace (like the std:: thing in front of cout). Another thing that C++ has is function overloading, which enables you to have multiple functions named "Log" as long as they have different parameters to the function. (ie. Log(int i); or Log(char *str);) I'm sure Yan will cover this eventually.
Wow, Amazing! I took a C++ course at University and I dropped it. I thought I was bad at it. I am following your videos and I realize I get it. So my PHD. professor was the one failing to teach well. Wow thanks a lot.
Thank you for this great video! I have a question: instead of a declaration of a function in another file, can you use #include and then the file name? What if you had a file with ten functions, do you need to declare each function, or can you just #include the file containing the ten functions?
I'm learning both assembly and C++, so in most part I understand how compiling works :) The simpliest printf in 4 machine commands for x86-64 processors: .686P .code _start: mov ax, 9 mov dx, offset Message int 21h Message db 'Your string$' end _start
i cant implement the solution here once i add the void function and debug .. it throws Compiler Error C2882 .. our code is exactly the same. i am wondering if things have changed since he made the video set?
For MacOS Users with XCode: 5:05: Product > Scheme > Choose Scheme 7:40: Click on your HelloWorld project > Build Settings > Make sure "All" and "Levels" are selected
This video helps me understand all of the stuff my professors just kinda brushed over in their lectures I love it! This is the first time I've seen this channel, but I am already a loyal subscriber! Please continue to output this quality content!
Thank you so much for this video series! It is helping me connect so many dots in game and general programming - concepts that I couldn’t quite grasp from others’ explanations - much appreciated!
You wouldn't do it this way normally. You declare the function in something called a header file, so you still use a declaration but in this case it's usually not called a forward declaration. You would have a file called Log.h and there you would write the declaration, then you would have a file called Log.cpp where you write the actual code of the log function. Then you include Log.h in all the .cpp file that use that function. Actually when you include iostream, you basically include all the declarations of the iostream header file, which is not that different from including header files that you have written yourself.
There are some things that you can not do in Python, like custom memory management. Now you can say that is not really something that the user will be aware of, but then there are also some OS functions and access to hardware, that can not be done directly in Python. You can always write a C library and load it into Python, but that is no longer pure Python.
MsJavaWof, you do not really need to access memory directly, unless you are confident enough you will do a better job than the GC, again trying to make things faster! Also, I am talking about working on a hypothetical problem rather than extending or interfacing with an existing solution... how many Linux kernel driver writers have you actually met in person so far? ;)
In actually std::cout makes use of something called operator overloading. But in essence, somewhere in the iostream library is a function that does the printing. And so, writing std::cout
Really like this new series, I can see all the work you put into it so that it becomes a reference in the future. Good plan imo. Looking forward to learn things though :P
This video left me speechless. Very, VERY useful, brief and qualitative. One of rare treasures on TH-cam. It's a big luck for us to have such vids, so we can learn complicated stuff in such pleasant way (remember those old youtube screencasts made on mobile camera and that murmuring). Good-looking guy with nice recording stuff and speech together with laconic information mixed with really suitable background music. It seems I have no way not to learn c++ :-)
I was at school when pocket calculators first appeared.
Now 65, sitting here on a Saturday morning, learning c++ from a young man who's worked in the games industry. Amazing what is possible on the internet.
I remember when the only hope you had of learning this kind of thing was getting hold of a good book (and that was when libraries closed early on Saturday and were closed on Sunday)
Many Thanks for sharing your knowledge.
When I was in school smartphones came along, The knowledge of the world in the palm of your hand! I bet when I'm 65 We'll have room temperature quantum computers in our homes
@@mastershooter64 When I'm 65, I'll most likely be immortal because of how rapidly AI and tech is evolving ((14 btw))
@@SecuredConnection-jg7yv current AI is not real AI its far from it.
@@SecuredConnection-jg7yv yeah then we will wake up from sleep.
my guy is NOT 65
Damn dude, it's insane to see how you've gone from doing some low quality code rambling to neat, organized and well edited professional tutorials, and from a couple hundred to over 50k subscribers! Great job man, you've helped me tons in the past, keep doing what you're doing!
What'd you expect, he's not an armature. He's a pro! Don't forget it. And it is Mr. Dude. Get it right! "Respecto, holmes. You have to give it, to get it."
150k now!
Douchbag alert! James R, take your own advice, you pretentious asshole! The guy was just giving a compliment. The way you tell people what they should have said, you might as well just write everybody’s comments for them so you approve.
@@jscorpio1987 It's Mr. James R to you sir.
How did he become so good?
I have watched manu C++ tutotials on youtube in my professional career and I have never come across anyone who can do such a great job at breaking down complicated concepts into a very concise and easy to follow short lectures. You helped me to really understand how this stuff works. I wish that my university professors who taught/teach programming had half of teaching talent you have. Thank you!
All I can say is that these are hands down the best C++ videos I have came across. Nobody else even comes close.
I’ve been using C++ for 35 years but that’s one of the best intros I’ve seen, couldn’t have done it better myself.
35 years. Wow.
I've done C++ for years. And yep, I didn't know how C++ works. Thank you!
I said "whhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat"
@@mrreflecting4691 I said
"wwwwwwwwhhhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt"
billions of people use smartphones but they don't know how it works, they don't know the physics behind it
@@mastershooter64 ... physics... mhm
@@aw1lt what?
Wow dude... just wow.
I was about 12 or 13 when I first heard of C++... I had found out that its used for video games which instantly struck my interest... but it wasnt until I was about 16 or 17 that I started dabbling in it and I thought it was too difficult for me to understand, and I thought you had to be extremely smart.. I am now 19... and have no idea where my life is going, I have always LOVED the idea of writing my own code, because its the closest thing to actual magic.. I’ve recently started trying to understand the concepts of c++ and how it all works.. I have a basic understanding of it all, and I really really wanna learn it. I’m going to go to college to get a BA in computer science. Whether I help make the next AAA title, or the next microsoft... I just want to code.. I’m very entrepreneurial as well so I don’t see myself working for someone
This is the first tutorial of yours that I’ve seen, and you made me understand the most basic c++ program even more than before. I’m looking forward to watching the rest of this series and I hope you continue it.
I personally would have started with Python as the first language. The simplicity of its syntax really helps new developers.
How's programming going?
@@LeeroyFan101😂😂😂
im 19 too and i feel like we twins because everything you said was like me talking about my life but i actually went for civil engineering but still wanna learn C++
@@studyagain8701 Me too bro
I found Cherno yesterday and coming in, my thinking was that C++ was super hard core and probably beyond me at this point. I have to say, after watching this video, I understood everything. I'm not saying I'm smart, I am saying this dude is a great teacher. Clarity, repetition, efficiency of explanations. I am almost thinking C++ might be a better first language to learn than Java. I've learned the basics of Java already as part of my bachelors degree. At this point I'm on the fence about which way to go. But if the lessons are like this one, I don't see C++ being that scary hard language to learn that everyone says it is. And that would be a testament to the teacher. Great work.
I learned C++ as my first language and altough it was quite tricky to wrap your head around some of it’s concepts in the beggining, it made it really easy for me to later learn new languages such as Javascript and Python.
Hey quite a lot of time passed
Update would be awesome
yea, late reply here....but Java as a first language has been considered a pretty bad idea for quite some time now. But don't get me wrong, I'm not one of those folks who thinks if you start off in the "wrong" language that you're RUINED FOREVER (!! -- seriously, some ppl think like this). Java is cool. I think the top2 languages for first timers atm would be Python (by a huge margin) or C (for the "bottom-up" approach).
Actually I think Python is best to learn first, which I luckily did. I think C++ ist more important than Java so I am actually planning on learning C++
@@intuit13 started off with C as part of my bachelor's degree. Makes it way easier to grasp C++ in my opinion. Using Python as a starting point works but the way it's written (and in some cases the way it works) is pretty different to C++. I'd recommend it as a starter but not if your final aim is learning C++.
Udemy ad: "Hi! Would you like to pay for some crappy, inferior class to teach you what you're learning here for free?"
duuude exactly. I'm getting Udemy ads 9 months later still
I got one for Python.
Fucking python.
On a cpp tutorial.
Use Add block dude.
@@andreidodu5581 I usually use ads block, but whenever I watch the Cherno video I don't activate it so that he can get ad revenues.
@@hokhyt
I love that you're going into all the details of IDE shortcuts and structure as well as C++ technicalities. Keep it up!
Just wanted to say thank you. I tried coding when I was a teen but failed and quit (there was no TH-cam back then). My son is interested and I thought we could learn together. Your videos are very well explained and I really appreciate the effort that you put into you videos.
So, I am a working professional. But I had to teach a friend of mine, the basics of C++. For that, I was looking for some easy videos.
Man, This guy explains so well.
One thing is for sure when I get married and if I have kids and if they choose to become a Software engineer, this guy is the one I am gonna send my kids for tuitions.
lol
why tuition when its out here on youtube for free
this was future planning ultra pro max
Any kids yet?
yeah bro did you get married?
Dude this is high quality stuff! I'm studying Computer Games Development at University and have learnt more from your C++ series than I have all year! Really looking forwards to digging into your OpenGL series. Thanks so much for bringing this great content man and please keep it up :D
After many tries to get into coding, I again started an approach and found your series here. Well done! As you start with the basics, it feels like it gives me the right entry point to finally understand some fundamental layers I didn't have in the past. So my hope now is, to finally get deeper into coding. Good job!
Once you are past tutorial level throw tutorials into trash and start working on your projects tutorials are going to help you with basics but after that you need to start working on your own with help of google maybe but tutorials shouldn't be part of your daily life anymore.
Your videos should have been the first thing that popped up when I searched C++ tutorial. I went through a 100 video course that skimmed over very important concepts I wish I learned sooner. You're doing a great job!
This is probably the best programming tutorial I've watched! It explains everything! Keep up the good work.
this is series is great so far. I have zero experience in programming, and you've explained everything so well so far. I dont feel lost. thank you!
Good luck buddy
This is the best tutorial series for C++ in existence..
No seriously, this guy is the ultimate tutorial master! The way he explains things is extremely easy to follow and understand!
Liking the quality of this series - you seem to have really upped your game. Love the ambient music, cool touch :)
Finally a cpp tutorial that doesn't treat me like a dumbass, I am an intermediate coder in lua so I know a lot of programming practices and what it means, your videos are good unlike those videos who waste your time by teaching you like you never touched a computer
Wow TheChernoProject, I just currently came along this video and I must say it got my attention. Even though I like to code in C# (as a hobby in my free time, I am not any professional or something), after watching this video you really caught my interest in watching how the whole c++ thingie works and how everything in programming ties together to create an executable file. I was so hyped watching on how the linker and the compiler works, but then saw that they are coming soon and this video just came 4 days ago. However I subscribed and turned on notifications so I don't miss the next one. Keep up the good job, you're awesome! :)
Have to learn C++ for a class that the teacher does not know how to code in C++. Your videos are the only ones that aren't hours upon hours long. Cheno you are my only hope.
"Compiler trusts you.."
finally someone who trusts me:')
@Ahmed M :')
One month of agony with c++ is neatly compacted in 20 min video. thanks Cherno
I really love how you explain things. It's very precise and simple. I really need to thank you for that :)! Keep up the good work.
Omg, this is insane, years learning programming and nothing like this, well explained and makes you think about the real power of c++, DAAM! Thank you so much.
Damn man, starting to learn C++ this week - what an exceptional video! Can’t wait to binge your entire series.
did you learn c++???
@@TeeHeeWinning I didn't... However please don't let this put you off. I didn't because I was a Python programmer and was learning C++ for the wrong reasons, and so my motivation failed me, or itself. I'm waiting until I get a project idea and then I'll learn around that. If you know one programming language well, the rest fall in line. Good luck :)
@axedow Sorry I didn't see this notification. I always wish people replied to these comments, looks like it's a TH-cam problem. See my other reply if you're still interested :). Hope you're well.
@@juleswinnfield1437 The only programming language I’m decent at is the lua version of roblox. My motivation for learning c++ is to learn how to make ESP in other games. Cuz I don’t really know what else I would do with c++. Anyways good luck with learning more languages.
@@TeeHeeWinning Funny you should say that, because I was originally learning C++ to make cheats for CS:GO. It didn't work out for me, as understanding the tricky aspects of C++ is hard, especially for a kid tryna make CS:GO cheats. People learn differently though!
I've been coding in C++ for 6 years now and this is the first time I know these information in this video. Thanks cherno
The man said that the compiler will trust us! Classic.
I've watched so many courses on different programming languages, and they're always so boring, they don't engage me and keep my attention, but everyone of your videos have held my attention and I'm so thankful to have you as a resource.
I DONT WANT TO WAIT FOR THE NEXT VIDEO PLEASE.
I've been trying to learn a coding language for years. This stuff is actually making sense and I can actually make decent notes. Thank you for explaining this stuff simply.
Woah man, you have improved so much from before, its amazing. Keep up the good work.
Ther Cherno is the only TH-camr where you have to slow down his videos because he gets straight to the point so fast xD
summary:
Our code gets translated into a binary, and the binary can be either a library or an executable file.
x86 = win32
There are 2 main options that we can choose when building our code in visual studio. One is the platform, and one is the mode of building.
Platform refers to the operating system that we are targeting our app for. It can be either android, windows, mac(?) and so on.
Mode of building refers to whether we are building the executable file in debug mode or release mode. Building on release mode runs much faster than debug mode, but is less helpful when debugging. For devlopers until the release of the game, they will be using debug mode untill the project is complete.
For each building mode, we can see the micro settings when we right click the project and go to settings. We also take a look at the linker settings in the same window.
The output window shows all the errors, and we are expected to debug using the information provided there. We do not want to rely on the error list, since they just display what the machine can understand from the output screen, which is too superficial for actual developers.
#include is something that is called a pre-processed statement, meaning that it is being compiled before our main body of code. In this case, #include means that copy and paste everything in a file named to this file.
//I believe #include command is something similar to the 'import' command that is used in python to call for modules. Cherno explains that #include is copy and pasting the file into the current file, which is exactly how a module is imported in python through *import library* command. Python also runs the whole code that is in the stated library before running our main code, if we import something from a library!
In a project, it is very likely that we will have multiple cpp files. Those cpp files will be converted in to an object file. These have their file extensions as obj, and can be found at certain directories. Those obj files can then be stitched together using the linker.
Cherno demonstrates how to use this kind of system. He uses the common 'hello world' code. He then chooses to define a function that prints out hello world, instead of using the common cout
thank you
why couldn't they have combined the simplicity of python with the power of c++
Salute!
Thank you very much! This was very useful.
Great scott. You have earn 1 subscriber today. I'm going through you're all the 97 c++ based videos. Thank you very much.
For those who dont run Visual Studio IDE, you need to include the log file in your main.cpp like this: #include "Log.cpp"
At 17:00 , If you're compiling this code on VS Code Editor, you might get an error saying :
error :
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\ASUS\AppData\Local\Temp\ccoFOfoQ.o:main.cpp:(.text+0x16): undefined reference to `log(char const*)'
collect2.exe: error: ld returned 1 exit status
Reason : We are getting this error because the text editor (like VS Code) sees different files rather than seeing it as one unit (like in Visual Studio IDE)
Solution :
If you have two files, 1) main.cpp (includes declaration & calling of function which is situated on other file).
2) log.cpp (definition of the function which wil be used in "main.cpp")
Now , use just need to add (#include "log.cpp") in the main.cpp file to include all the function defined in log.cpp at the runtime.
also, try changing "#include log.cpp" to "#include log.h" (also rename "log.cpp" to "log.h"), So that the compiler wil take it as a header file.
code :
> main.cpp
#include
#include "log.cpp"
void log(const char* message);
int main(){
log("Hello World");
return 0;
}
-------------------------------------------------------------
log.cpp
#include
void log(const char* message){
std::cout
You are like a fresh breeze. I am a software engineer. I came here through PS5 tech demo and saw you are an X EA developer. Your teaching style is just amazing. Really liked your videos.
i have been watching ur Videos for a few years now but you reached a New quality level with this Video. very nice :)
i just wish this guy get more attention,The WAY he Explain is so flawless
Dude, I just have to say THANK YOU!! I've been struggling to learn C++ on my own for a length of time which I'd rather not admit lol and sometimes books and forums just don't cut it. I've been looking for something exactly like this for so long, and here it finally is. So far I've only watched this and your video on templates, but you have a knack for explaining things in such a way that it's all finally starting to make sense to me. So again, thank you for the awesome content.
Bro just download solarlearn :/ or run of on youre browser.
It is profound that you include how #includes are preprocessed, pun intended. This becomes very important later in the linking video. Your ability to teach what you understand is very impressive and very helpful to us that are just learning C++. You clearly understand what we need to know. Notice my grey beard; this is not my first C++ rodeo! Thanks.
Why did it take so long to find this course through youtube search?? Thank you so much!
finally someone who explains everything and doesn't say we'll get to this later every two words. Thanks!
Thanks for your videos; they're very good. Please continue with the C++ series.
I think this is the first time, I hear someone explaining as simple & understandable as possible, how compiling and linking works in cpp! really great videos!
Your background music is saving my life, thanks for making "easy to swallow" videos for average audience like me 🙏🏻 the music is making me more focused on the content, other channels without music is boring and easy to be distracted
omg exactly, the music blends in with the tension of the explanation sooo well
For those who wonders what happens if you have 2 cpps files with the same methods and try to build it, the output will throw the following error: LNK2005: "void __cdecl log(char const *)" (?log@@YAXPEBD@Z) already defined in Log1.obj
and: fatal error LNK1169: one or more multiply defined symbols found
So your linker doesn't know what method definition it should use for the declaration on main file.
Excellent video, btw! You made something complicated seems simple and that's not easy job.
Excellent video. I know C++, but I love the way you teach this -> I watch it. Can't wait to see more and getting into more advanced topics (maybe some topics like engine design, optimization or targeting multiple platforms...). When can I expect some of these topics to come (if you plan on making a video about them)? (take your time, I fully understand that you want to teach C++ from the very basics, I am just interested... ^^) Thank you for this video and keep up the good work, looking forward to the next episode. :)
I love how your videos contain epic background music. It makes your tutorials and explanations significantly more engaging than anything else I have seen on youtube.
The music here makes me feel like I'm planning to sneak into a top secret military base
Revisiting all these first videos months after starting learning C++ are so important and so much more informative. Now we can add all the pieces together and finally understand something. That's not possible in the beginning.
Your tutorials are amazing!!! Thank you so much
1:22 I wasn't listening very intently and heard "These files are called pedophiles"
Excellent video ! That was extremely helpful. This basics stuff is so poorly taught in most tutorials.
dayum, you are a life saver! providing such background music was very ingenious touch - puts you in a state of productive trance
Finally, a C++ tutorial I can recommend to my students. Very well done.
One minor nit: stop using std::endl. Just use '
'. '
' does the same thing as std::endl, and doesn't have the side effect of flushing the output buffer. Normally this won't matter, but if you're writing a large file over, say, a very slow VPN, it can take forever. Besides, it's less to type.
The next two videos are sooo important. They will give you hip boots to wade around in the error swamps that you will cause in the future.
Dude when you type c++ in youtube your channel does not appear any soon, i found you on a twitter mention. Why youtube is doing this to us?
4:35 I wasn't paying attention and heard "Pedophiles" instead of "header files"
same here.. been spending way too much time on pizzagate and qanon vids
Do pedos keep their CP in a folder named Pedo Files? It's 3AM and this is keeping me up.
Polluted mind test
Ah yes the famous Pedophiles subject of the C++ language, every developers goes through it
will talk about "pedophiles" in more depth. :)
You have no idea how much this helps people man. Thank you so much. I'll hope my determination won't die in few weeks later on.
Hail, Cherno!
Woo! I now have VS 2017. I certainly have been enjoying VS 2015.
VS 2017 looks way better and is way cooler.
I love your video style, the quick short talks with cuts and the music.
(5/5)
That's the holy video of all Cpp tutorials, unbelievable. Thank you so much sir.
*cin.get()*
For entering any character not only enter button.
Thank you, was wondering how the enter button was specified.
Cool channel C 4 Code I subed
Small caveat, the computer doesn't start running main right away. There is a bunch of code that c++ inserts before the call to main to set some things up and then it calls main. Same thing happens once main terminates. There is some code c++ inserts to restore state and put the return value in a register
Love the background music - is this a playlist you have. could you drop artist in here?
My third time going through this series, I wish I could thumb it up again. Thanks Yan.
Small correction: 1:33 cout is an object, not a function
The way you anticipate the questions is really nice, and I like the way you talk. Very nice quality, looking forward to watching your other videos!
What happens if you have another cpp file with another "Log" function that has a different body? Which function will be executed?
hululu36 it will throw an error about redeclaration of a function.
If you need two different log functions that have the same parameters, you need to either rename the function, or use a namespace (like the std:: thing in front of cout).
Another thing that C++ has is function overloading, which enables you to have multiple functions named "Log" as long as they have different parameters to the function. (ie. Log(int i); or Log(char *str);)
I'm sure Yan will cover this eventually.
^ ^ ^ CLIFFHANGER COMMENT ^ ^ ^
there are ways to make that work, but I don't think it's important just yet.
Maybe the linker complains about an ambiguous reference? sry, idk.
3 years later and this still being the best C++ course! Thanks you!
MORE MORE MORE!
Wow, Amazing! I took a C++ course at University and I dropped it. I thought I was bad at it. I am following your videos and I realize I get it. So my PHD. professor was the one failing to teach well. Wow thanks a lot.
Thank you for this great video! I have a question: instead of a declaration of a function in another file, can you use #include and then the file name? What if you had a file with ten functions, do you need to declare each function, or can you just #include the file containing the ten functions?
You're great, I'm a 15 years old italian guy. I don't know very well english language but I understand everything about this video. 💪🏼
I'm learning both assembly and C++, so in most part I understand how compiling works :)
The simpliest printf in 4 machine commands for x86-64 processors:
.686P
.code
_start:
mov ax, 9
mov dx, offset Message
int 21h
Message db 'Your string$'
end _start
I feel like with a big c++ project you should just put "using namespace std;" line in the top of your code.
He made a video explaining why it might actually be _worse_ to use "using namespace std;".
i cant implement the solution here once i add the void function and debug .. it throws Compiler Error C2882 .. our code is exactly the same. i am wondering if things have changed since he made the video set?
@@reiter2148 link?
For MacOS Users with XCode:
5:05: Product > Scheme > Choose Scheme
7:40: Click on your HelloWorld project > Build Settings > Make sure "All" and "Levels" are selected
Thanks!!
that was nice. just like always.
I have started with your training. I have experience in C# and I want to jump to C++. You explain everything very good. Thank you.
Great explanation. Thank you.
What is the name of music in background?
I'm taking an online intro to programming class, and you are so much more helpful than my professor! Thanks for your uploads!
where did you learn all of this?
@math im curious too
This video helps me understand all of the stuff my professors just kinda brushed over in their lectures I love it! This is the first time I've seen this channel, but I am already a loyal subscriber! Please continue to output this quality content!
int main(){
court
}
is it true or false
Thank you so much for this video series! It is helping me connect so many dots in game and general programming - concepts that I couldn’t quite grasp from others’ explanations - much appreciated!
For larger projects, do you still use forward declaration?
You wouldn't do it this way normally. You declare the function in something called a header file, so you still use a declaration but in this case it's usually not called a forward declaration.
You would have a file called Log.h and there you would write the declaration, then you would have a file called Log.cpp where you write the actual code of the log function. Then you include Log.h in all the .cpp file that use that function.
Actually when you include iostream, you basically include all the declarations of the iostream header file, which is not that different from including header files that you have written yourself.
this video is just something you'll appreciate more and more once you know more about programming concepts
c++ is the hardest language when you do it youll find c# java easier atleast i did
Pulsxr, not really. You can do faster with C++, but you can do just as much in Python, Haskell or Lisp
There are some things that you can not do in Python, like custom memory management. Now you can say that is not really something that the user will be aware of, but then there are also some OS functions and access to hardware, that can not be done directly in Python.
You can always write a C library and load it into Python, but that is no longer pure Python.
MsJavaWof, you do not really need to access memory directly, unless you are confident enough you will do a better job than the GC, again trying to make things faster! Also, I am talking about working on a hypothetical problem rather than extending or interfacing with an existing solution... how many Linux kernel driver writers have you actually met in person so far? ;)
You are the my favorite C++ teacher. Thanks for generousity.
I had no idea you could do cout.print(). Makes sense but woah.
LOL
In actually std::cout makes use of something called operator overloading. But in essence, somewhere in the iostream library is a function that does the printing. And so, writing std::cout
Me too LOL .i was shocked ,i always hated these two arrows
But we can't use print instead :(
It's not code that will actually work, it's more like a mental model that can help with understanding it.
Really like this new series, I can see all the work you put into it so that it becomes a reference in the future. Good plan imo. Looking forward to learn things though :P
Feels complicated as a beginner
That’s because it is complicated
Cherno you deserve more subscribers, this stuff is crazy good. The style is actually pretty cool too.
Great background music choice.
13:09 "Just to make sure that it still works " 😂
music is kinda distracting.. I feel like I'm in a mission impossible movie bahaha
This video left me speechless. Very, VERY useful, brief and qualitative. One of rare treasures on TH-cam. It's a big luck for us to have such vids, so we can learn complicated stuff in such pleasant way (remember those old youtube screencasts made on mobile camera and that murmuring). Good-looking guy with nice recording stuff and speech together with laconic information mixed with really suitable background music. It seems I have no way not to learn c++ :-)
Terrific tutorials, except for the distracting background music...