You should market your videos through blogs and other resources to get more views because everyone is right when they say you have probably the best (highest quality) programming tutorials on RUclips
I've been programming as a hobby for 5 years now and know all of this stuff, but I still find it entertaining to watch. I really wish you were making these when I was first starting out, you do a very good job of explaining, and go into thing that most people leave out. Nice job, keep it up!
Patrick Torgerson Same here, but for about 2.5 years. I know everything that has been covered so far, and I imagine I'll know *most* of what is taught here (there were some topics in the introduction video I know I'm not solid on), but I'm watching every minute to support Cherno and pick up any fine details and points that I will have inevitably missed :)
2024 and learning c++ and this video playlist still pops up in OTHER RUclipsRS vids saying things like “Go watch this cos it’s amazing!” And they aren’t wrong, this is gold mate, bless ya haha ❤
Should note for those watching. An unsigned int is generally reserved for special situations where the sign would cause specific error problems, not just because you are on your last bit. For general math if you are on your last bit best practice is to use a "wider" type such as a long or float. This is to improve future maintainability and avoid weird bugs, of course there are some exceptions to the rule but they are advanced cases such as memory limited micro-controllers where single bytes really matter or very advanced high performance bare metal coding where the hardware structure is considered in data transfer and physical location.(where microsecond lags matter or the calculation takes a 10 000 core machine several months(while using nearly half of a megawatt) 5cm of wire is about a cpu cycle)
Dude.. What a gold mine of a RUclips series! Best videos I've watched on here for a while now. I have a C++ recruitment test in a few days and felt quite lost to be honest, but now I'm finally understanding what's happening without just writing some code and pressing "build & run" (like I did with an IDE before at uni without really knowing what was happening behind the scenes)! Thank you so much my Aussie friend :) Love from Norway
You are an amazing teacher! I'm an experienced programmer, but I never formally learn C++, and even though I already know what variables are, I still feel like I learned something from this video.
No one ever reached my brain as efficiently as this guy. In a way, he really knows how to allocate memory registers in my brain, so I can remember and actually use the information stored. This is surreal.
I just started learning C++ [about 2wks now]. Actually found this channel and video series so helpful. Thank you so much, man. You know how to teach. No joke. Greetings from Nigeria.
Excellent explanation of what is happening at the low levels of the computers operation. This is commonly left out of other tutorials but I feel it is essential knowledge to have in order to really know what you are doing when writing code. Thanks for the great videos!
I'm 64 next month been a pro C++ programmer since it was invented, and C before that. I just LOVE the way you can lie through your teeth to get to the central truth, and sidestep the the baggage. That's how to teach! I mean the accurate truth is that the only difference that matters between built in types is the compiler type checking, but if you only have one simple message to give... yep "size" is a better "take home" answer for the student! A physical thing trumps an abstract one, you dont confuse half the class... AND you don't have to say "another video later about that"... again(!) LOL. Keep it up Cherno I really like your stuff.
Awesome way of explaining C++. I have seen quite many other tutorial, jumping directly into details. Showing first the big picture and the concepts creates lots basic understanding. Quite an eye opener, very interesting. Thanks a lot!
First of all you do this really good, keep it up. @9:22 i want to add this, 5.5 there is a double, but implicitly cast back to a float, since we assign it to a float.
This is a really good series nice job. I'm excited for the videos on pointers and references those things always confused me when trying to program in C++
Man I remember those days...because they were only two years ago. Don't worry man, pointers will click eventually. I think of them as directions to my data. Your boss asks you for some report, where is it? In the filing cabinet in the third drawer. The pointer is the address or location of my data, in this case the third drawer of the filing cabinet. With pointers, the variable that stores a pointer can be changed to point to anything of the same type ( technically anything if casted ). When you remove the report and hand it to your boss, the location of that data changes. References are basically restricted pointers. You can't reassign a reference once it's initialized, but you can change the data that it refers to. So using our scenario above with the report, the reference to the report will always refer to the report or something like a reference to the filing cabinet with all those reports. The reports inside can be changed or moved around, but the reference to the filing cabinet will always point/refer to the filing cabinet. I'm sure TheCherno will explain this much better than I have, so just wait for him if this has been clear as mud.
my utter respect for u being that smart & good in explaining with 22 years old back than. i needed 8 hours just to understand the concept of variables. using ur & some other videos and writing down several definitions and examples. now watching this video again and fully understanding all of what ur saying :)
These tutorials are really giving me a head start before I go back to school in September. Thank you for this! I've also really wanted to switch over to Unreal from unity for a while now and this is the C++ content I've been searching for!
These tutorial's clearly not for starters, but for those who do code already but want to know what's actually happening behind that, and it's just what I need, thank you
I have watched the first 21 videos and am rewatching from this video for the second time after also reading on a website and using an app with practice code and watching it a second time I am following along much better and even getting ahead this time! Your videos are great and I will likely be rewatching this video again later on to solidify my knowledge a bit more! Great series!
I'm actually wanting to learn about block variables, static variables, function variables etc, but ended up learning about data types :') Anyway, good quality video.
I think if you do not mark your float with a postfix of "f" the act of preparsing the code treats it as a double. But only at Runtime it seems to notice that it is a float float var1 = 3.2; float var2 = 3.2f; // Notice Postfix "f" sizeof(var1) == sizeof(var2); // Returns true (Both variables have 4 Bytes in size, therefore both of them are floats).
Thank you for making this series. I started learning C# last July (it is now November) and have hit a point where I'm comfortable in C#, but I know for what I want to do with programming. C++ is way better suited. This series has helped me tremendously in getting my foot in the door with this incredible language.
I tried to learn C++ in middle school and shied away in frustration. I learned a little bit of python through high school. As a post-grad, an adult now, I got C# down under my belt. But going back into C++, the first thing that hurt my brain was that the main function was an integer. This confused the holy-mother-of-god out of me so badly, but I'm finally starting to understand it better.
I honestly kind of wish that I hadn't chosen C# as my first real language, but at the same time it set up a decent foundation for me to start understanding how programming works. It's just a little counter intuitive to try to unlearn the many high-level conventions surrounding the C# syntax, and understand what is really going on behind all the automatically-handled, do-it-this-way kind of rules attributed to C#.
11:20 => "C Bit Fields" would allocated just how many bits for certain variables as needed, if one needs bunch of boolean but wanna save them in one byte.
Sorry for my English. I want to correct some phrases. Actually real max value of unsigned int is 2^32 - 1, not 2^32, because, 0 take one position. Max value of signed int is 2^16 - 1 for the same reason. However min value is -2^16. This occurs because zero take only one position from positive range, and don't take from negative range. I think very important various types no only has various sizes. They are variously intrpreted by compiler. However we can force to interpret them as another type.
"Cherno" means "black" (color) in Slavic languages. Actually chernobyl (чернобыль) is the name of Artemisia vulgaris in Russian, which is a common plant (not nuclear, but a weed) in Europe.
This is truly a great series, the combination of visual studios view, and the facetime while explaining certain things is a helpfull change from other tutorials ive seen. Are you planning on making a video for how to understand large codebases? I started a new job recently and was overwhelmed by the size and complexity of the code, accross headers and modules. Anyways, thanks for the great videos :)
i need to say that more tutorial channels need to record in wacky places like their cauch, bed, or living room idk why but it makes it feel like its not a tutorial, it feels very welcoming, makes me wanna learn more for some reasson.
this series so far, is one of the best teaching series ive seen so far. Once i get my first paycheck ill supp you on patreon man, you explain this a milion times better than any other teacher whom i met trying to explain c++
ChiliTomatoNoodle does a pretty good job IMO. You should check out his stuff if you want a follow along graphical experience. Chili's tuts are geared toward making games, simple ones at first like Snake and Arcanoid clones.
Note that char, signed char, and unsigned char are different types. Basically, signed char and unsigned char are exactly like int and unsigned int and are meant to represent numbers. On the other hand char is meant to represent a character and it's unspecified if its underlying representation is a signed char or unsigned char. If you're doing low-level bit level stuff, you want to use unsigned char.
@@siman211 It is a good start to watch this series but trust me, nothing is good enough to teach you C++, I really recommend you to have a solid book/s as a reference/s to look at whenever you need an explenation or you can look into documentations. I didn't try paid courses but I really think that you can find way better information for free if you are interested enough to search for.
Quite good explaination but the 1 bit is not for the negative sign it stands for the smallest nr. so a signed int8 would be: -128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 ... that also why it rages from -128 till +127. ... pretty sure you know that but the explaination was maybe a bit oversimplified.
global (extern) and static variables are stored on the data (initialized) and bss (uninitialized) segments, not on the stack or the heap. long and long int are exactly the same.
You are doing a great work for programming students like us ...Your videos are really amazing than some of our university professors .Really thank you so much from India🇮🇳
summary: variables are name that we give to a peice of data, and is needed because we have to manipulate, read and write the piece of data. Every variable type in c++ has a specific purpose, but we don't have to use it for that purpose. Every data type in c++ is either stored in stack or heap, which are both memories.(this topic will be covered later) The most basic types of number data are char, short, int, long, long long. Each of these data types have a length limit to what values they can hold. For example, int, which is 8 bytes long, is 32 bits long. This means that in its binary form, it can store either 0 or 1 in 32 places. Assigning one place of 0 or 1 to hold the sign value, it leaves 31 places for us to assign the numeric value. Calculating 2 to the power of 31 will result in 2 billion and something, which is the actual limit of both positive and negative ends of what can be stored in an int variable. This logic can be extended to other data types using the following information. char: 1 bytes short: 2 bytes long: 4 bytes (depends on the compiler) long long: 8 bytes These data types can also be used to store alphabets(strings), since the characters at the end of the day, have a number assigned to each of them. For example, we can store the string 'a' in a variable defined to be an integer. It has the number 65 assigned to it. However, depending on which number data type that we use for the varialbe, 'a' can either be represented as 65, or 'a' itself when it is printed out in the console using the std::cout
One minor addition: If you want a bool variable to print as "true" or "false", just precede it with the std::boolalpha I/O manipulator: bool b = true; std::cout
"There are very few rules in C++"
compiler: *"you have 9001 errors in your code"*
9001?
Wow thats alot
@@xrafter Indeed, IT'S OVER NINE THOUSAND!!!
@@Trueblue4ever559
I don't see that amount in my life
There's no way that can be right!
*program is literally Hello, World!*
Jesus christ, the production quality just went through the roof. I really hope that this series gets more attention.
I know right!
Glad you're enjoying it! It feels much better to be producing higher quality content, much more satisfying :)
You should market your videos through blogs and other resources to get more views because everyone is right when they say you have probably the best (highest quality) programming tutorials on RUclips
No swearing please ⛪️
No swearing please
I've been programming as a hobby for 5 years now and know all of this stuff, but I still find it entertaining to watch. I really wish you were making these when I was first starting out, you do a very good job of explaining, and go into thing that most people leave out. Nice job, keep it up!
Patrick Torgerson Same here, but for about 2.5 years. I know everything that has been covered so far, and I imagine I'll know *most* of what is taught here (there were some topics in the introduction video I know I'm not solid on), but I'm watching every minute to support Cherno and pick up any fine details and points that I will have inevitably missed :)
I program for 12 years, I watch those videos because sometimes new employees ask me about programming concepts, I want to improve my teaching skills.
Can you help me in my computer programming class then 😅
"There are very little rules in C++"
...Until you start pushing your code to the company repo.
Sorry, didn't know your company is a part of C++
Lmao, even got logo on the pillow
Resantic It’s so bright, I almost think it’s edited in
Automamada
2024 and learning c++ and this video playlist still pops up in OTHER RUclipsRS vids saying things like
“Go watch this cos it’s amazing!”
And they aren’t wrong, this is gold mate, bless ya haha ❤
Should note for those watching. An unsigned int is generally reserved for special situations where the sign would cause specific error problems, not just because you are on your last bit. For general math if you are on your last bit best practice is to use a "wider" type such as a long or float. This is to improve future maintainability and avoid weird bugs, of course there are some exceptions to the rule but they are advanced cases such as memory limited micro-controllers where single bytes really matter or very advanced high performance bare metal coding where the hardware structure is considered in data transfer and physical location.(where microsecond lags matter or the calculation takes a 10 000 core machine several months(while using nearly half of a megawatt) 5cm of wire is about a cpu cycle)
not just because you are on your last bit => Got it.
Dude.. What a gold mine of a RUclips series! Best videos I've watched on here for a while now. I have a C++ recruitment test in a few days and felt quite lost to be honest, but now I'm finally understanding what's happening without just writing some code and pressing "build & run" (like I did with an IDE before at uni without really knowing what was happening behind the scenes)! Thank you so much my Aussie friend :) Love from Norway
You are an amazing teacher! I'm an experienced programmer, but I never formally learn C++, and even though I already know what variables are, I still feel like I learned something from this video.
It's definitely the "only difference is size" part that gave that vibe 😁😁
You have a differnt way to teach, it make learning cpp possible for me. Peace
Exactly
This video was great. It covered the basics as well as common pitfalls like compiler specific sizes.
I have never seen programming explained like this. you did a perfect job as teaching.
Dude you're making c++ possible to understand. Thank you!
No one ever reached my brain as efficiently as this guy. In a way, he really knows how to allocate memory registers in my brain, so I can remember and actually use the information stored. This is surreal.
I just started learning C++ [about 2wks now]. Actually found this channel and video series so helpful. Thank you so much, man. You know how to teach. No joke. Greetings from Nigeria.
Even after taking a few programming classes there's still a plethora of information here. Thank you very much Cherno for going into the little things.
the signed and unsigned make so much sense here!!! Thank you The Cherno!!!
Excellent explanation of what is happening at the low levels of the computers operation. This is commonly left out of other tutorials but I feel it is essential knowledge to have in order to really know what you are doing when writing code. Thanks for the great videos!
I am glad I found your channel...
I wish any of my professors were into explaining us so patiently and selflessly.
Thankyou brother!
You gave me the utmost clarity of variable ❤🙏
This totally expanded on what I've read in my self-teaching. Thanks!
I'm 64 next month been a pro C++ programmer since it was invented, and C before that. I just LOVE the way you can lie through your teeth to get to the central truth, and sidestep the the baggage. That's how to teach! I mean the accurate truth is that the only difference that matters between built in types is the compiler type checking, but if you only have one simple message to give... yep "size" is a better "take home" answer for the student! A physical thing trumps an abstract one, you dont confuse half the class... AND you don't have to say "another video later about that"... again(!) LOL. Keep it up Cherno I really like your stuff.
Awesome way of explaining C++. I have seen quite many other tutorial, jumping directly into details. Showing first the big picture and the concepts creates lots basic understanding. Quite an eye opener, very interesting. Thanks a lot!
Dude, thanks for this video and this course. I'm in a C++ class in school and this course is much better than any of the content I was provided!
This Cherno c++ series is all I wanted to understand about c++. Cannot thank you enough. The clarity in your explanation is exceptional.
Got this series linked on a subreddit. Best thing ever. Thanks;
This guy does make learning fun. Especially with the background music. And tbh i can't watch other youtubers than this one. Keep up the good work!
Need to say that this C++ series is amazing. Love it. Please keep doing it. Many thanks!
It is night and day following along with these videos after taking a c programming class.
First of all you do this really good, keep it up. @9:22 i want to add this, 5.5 there is a double, but implicitly cast back to a float, since we assign it to a float.
This is a really good series nice job. I'm excited for the videos on pointers and references those things always confused me when trying to program in C++
Man I remember those days...because they were only two years ago. Don't worry man, pointers will click eventually. I think of them as directions to my data.
Your boss asks you for some report, where is it? In the filing cabinet in the third drawer. The pointer is the address or location of my data, in this case the third drawer of the filing cabinet. With pointers, the variable that stores a pointer can be changed to point to anything of the same type ( technically anything if casted ). When you remove the report and hand it to your boss, the location of that data changes.
References are basically restricted pointers. You can't reassign a reference once it's initialized, but you can change the data that it refers to. So using our scenario above with the report, the reference to the report will always refer to the report or something like a reference to the filing cabinet with all those reports. The reports inside can be changed or moved around, but the reference to the filing cabinet will always point/refer to the filing cabinet.
I'm sure TheCherno will explain this much better than I have, so just wait for him if this has been clear as mud.
Yep, I'm going to make sure that video is absolutely perfect before I put it up
This is the best programming language tutorial I have watched in a long, long time. What a man right there!
Absolutely fantastic! You explain it so well, please.. PLEASE keep doing them and a big thanks!
Wow! I think it is the best video that I have ever seen about variables, very well explained. Thanks for your videos!
my utter respect for u being that smart & good in explaining with 22 years old back than. i needed 8 hours just to understand the concept of variables. using ur & some other videos and writing down several definitions and examples. now watching this video again and fully understanding all of what ur saying :)
Probably the best c++ tutorial series ever
Undoubtedly the best C++ variables tutorial out there. Keep it up.
Yan, I love the production value of this series, it really makes you look professional. Great job man, love the series
you has made able to understand what we want learn and probably you have taught us more...
My second time through the series so much information I am still learning new things.
totally agree
Kind of amazed at how much extra I'm getting from a 2nd viewing
These tutorials are really giving me a head start before I go back to school in September. Thank you for this! I've also really wanted to switch over to Unreal from unity for a while now and this is the C++ content I've been searching for!
I m in love with c++ , thanks cherno !!!
Thanks so much for making these videos. They're insanely helpful.
This looks like it's going to be a great series.
Quality playlist , content which is never shown in other similar courses
I'm tempted to learn C++ again watching this series. This is masterpiece.
I know you from Quora! ;)
These tutorial's clearly not for starters, but for those who do code already but want to know what's actually happening behind that, and it's just what I need, thank you
the quality of this video is OMG !!!! Very deep content!!! I love bro!! thx for ur teaching!
Really love the new format of these videos!
i'm fairly confident i could watch this without audio and understand what your saying from your hand movements it's actually quite mesmerizing
You just turned a whole CS semester into an ABC kindergartner class, Thank You
I have watched the first 21 videos and am rewatching from this video for the second time after also reading on a website and using an app with practice code and watching it a second time I am following along much better and even getting ahead this time! Your videos are great and I will likely be rewatching this video again later on to solidify my knowledge a bit more! Great series!
Thanks a lot. Like your compiler video this one too taught me lot of stuff. Very well compiled information.
Great work.
This is the best series for C++ for now. Thank you from morocco ♥
I'm actually wanting to learn about block variables, static variables, function variables etc, but ended up learning about data types :') Anyway, good quality video.
I think if you do not mark your float with a postfix of "f" the act of preparsing the code treats it as a double.
But only at Runtime it seems to notice that it is a float
float var1 = 3.2;
float var2 = 3.2f; // Notice Postfix "f"
sizeof(var1) == sizeof(var2); // Returns true (Both variables have 4 Bytes in size, therefore both of them are floats).
I love how this was five years ago and the production feel like this year. Just decided to learn c++
Yup... just wow
how is this going
@@Voskos let's just say I've jumped into the rabbit hole, learning about the Vulkan Renderer API😅
The largest number representable for an int type should be 2^31 - 1, Becasue C++ is using a two's complement, so the minus 1 is used to represent 0.
Thank you for this lesson
Thank you for making this series. I started learning C# last July (it is now November) and have hit a point where I'm comfortable in C#, but I know for what I want to do with programming. C++ is way better suited. This series has helped me tremendously in getting my foot in the door with this incredible language.
I tried to learn C++ in middle school and shied away in frustration. I learned a little bit of python through high school. As a post-grad, an adult now, I got C# down under my belt. But going back into C++, the first thing that hurt my brain was that the main function was an integer. This confused the holy-mother-of-god out of me so badly, but I'm finally starting to understand it better.
I honestly kind of wish that I hadn't chosen C# as my first real language, but at the same time it set up a decent foundation for me to start understanding how programming works. It's just a little counter intuitive to try to unlearn the many high-level conventions surrounding the C# syntax, and understand what is really going on behind all the automatically-handled, do-it-this-way kind of rules attributed to C#.
@Artem Katerynych Ohh okay. That makes a lot more sense.
*My takeaways:*
Define variables using pointers and references 12:30
Best youtube channel for c++ and game dev
11:20 => "C Bit Fields" would allocated just how many bits for certain variables as needed, if one needs bunch of boolean but wanna save them in one byte.
Sorry for my English. I want to correct some phrases. Actually real max value of unsigned int is 2^32 - 1, not 2^32, because, 0 take one position. Max value of signed int is 2^16 - 1 for the same reason. However min value is -2^16. This occurs because zero take only one position from positive range, and don't take from negative range. I think very important various types no only has various sizes. They are variously intrpreted by compiler. However we can force to interpret them as another type.
Got finals tomorrow online during this lockdown and I dont have a textbook or anything, so this really helps. thank you.
I'm so glad I found this channel! I want to learn game development and you're helping me so much!
Great series -- I can't wait for the intermediate and advanced stuff. :-)
damn! every freaking time i look up your name the freaking chernobyl disaster comes up scary af
"Cherno" means "black" (color) in Slavic languages. Actually chernobyl (чернобыль) is the name of Artemisia vulgaris in Russian, which is a common plant (not nuclear, but a weed) in Europe.
@@SantiRodriguezRuiz thanks wiki
This is truly a great series, the combination of visual studios view, and the facetime while explaining certain things is a helpfull change from other tutorials ive seen.
Are you planning on making a video for how to understand large codebases? I started a new job recently and was overwhelmed by the size and complexity of the code, accross headers and modules.
Anyways, thanks for the great videos :)
Thanks for the hard work on teaching
136 up, 0 down. That's telling of good this series is. Keep it up!
i need to say that more tutorial channels need to record in wacky places like their cauch, bed, or living room idk why but it makes it feel like its not a tutorial, it feels very welcoming, makes me wanna learn more for some reasson.
I'm here ... i love this series
this series so far, is one of the best teaching series ive seen so far. Once i get my first paycheck ill supp you on patreon man, you explain this a milion times better than any other teacher whom i met trying to explain c++
ChiliTomatoNoodle does a pretty good job IMO. You should check out his stuff if you want a follow along graphical experience. Chili's tuts are geared toward making games, simple ones at first like Snake and Arcanoid clones.
@@MrAlbinopapa i'm a bit too late, but thanks anyway x)
@@musikalniyfanboichik yeah, I'd say 3 years is a bit late, but no worries. Looks like I was just promoting my favorite RUclips creator.
9:56 bool stands for bullying! Nice generated captions
Once again ... Full of energy ... Thanks for the video .. Love from India.. :)
Note that char, signed char, and unsigned char are different types. Basically, signed char and unsigned char are exactly like int and unsigned int and are meant to represent numbers. On the other hand char is meant to represent a character and it's unspecified if its underlying representation is a signed char or unsigned char. If you're doing low-level bit level stuff, you want to use unsigned char.
Great videos! I am definitely going to support the channel
Love this series
Que didática sensacional!
You literally are a great teacher of C++
I'm studying C from a book called Learn C the Hard Way, you're essentially teaching C here since this applies there too.
As an intermediate C++ programmer, you explained this impressively!
You are a really amazing teacher, Yan. 👏👏
Hey i am new to programming is this playlist enough to learn c++ or should i try with a udemy course or book?
@@siman211 It is a good start to watch this series but trust me, nothing is good enough to teach you C++, I really recommend you to have a solid book/s as a reference/s to look at whenever you need an explenation or you can look into documentations. I didn't try paid courses but I really think that you can find way better information for free if you are interested enough to search for.
best c++ videos ever man thank you brogami
The difference between him and others is that he actually describes WHY things need to be done a certain way.
Quite good explaination but the 1 bit is not for the negative sign it stands for the smallest nr. so a signed int8 would be:
-128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 ... that also why it rages from -128 till +127.
... pretty sure you know that but the explaination was maybe a bit oversimplified.
global (extern) and static variables are stored on the data (initialized) and bss (uninitialized) segments, not on the stack or the heap.
long and long int are exactly the same.
I'm dissapointed, he didn't do "VROOOM" at the end
Também senti falta! hahaha
Great series. thank you!
You are doing a great work for programming students like us ...Your videos are really amazing than some of our university professors .Really thank you so much from India🇮🇳
This tutorial is amazing and you are really good at teaching !! great job sir !
Very useful for reviewing variables for C++
Keep up the good work bro!
Incredible way of teaching
I m so inspired
Keep on dear.....
I love you Yan, this series is a masterpiece!
summary:
variables are name that we give to a peice of data, and is needed because we have to manipulate, read and write the piece of data.
Every variable type in c++ has a specific purpose, but we don't have to use it for that purpose.
Every data type in c++ is either stored in stack or heap, which are both memories.(this topic will be covered later)
The most basic types of number data are char, short, int, long, long long.
Each of these data types have a length limit to what values they can hold. For example, int, which is 8 bytes long, is 32 bits long. This means that in its binary form, it can store either 0 or 1 in 32 places. Assigning one place of 0 or 1 to hold the sign value, it leaves 31 places for us to assign the numeric value. Calculating 2 to the power of 31 will result in 2 billion and something, which is the actual limit of both positive and negative ends of what can be stored in an int variable. This logic can be extended to other data types using the following information.
char: 1 bytes
short: 2 bytes
long: 4 bytes (depends on the compiler)
long long: 8 bytes
These data types can also be used to store alphabets(strings), since the characters at the end of the day, have a number assigned to each of them. For example, we can store the string 'a' in a variable defined to be an integer. It has the number 65 assigned to it. However, depending on which number data type that we use for the varialbe, 'a' can either be represented as 65, or 'a' itself when it is printed out in the console using the std::cout
But 'a' is not 65
'A' is 65
amazing explanatoion in short and crisp manner in thi entire world
One minor addition: If you want a bool variable to print as "true" or "false", just precede it with the std::boolalpha I/O manipulator:
bool b = true;
std::cout
Hey thanks for these videos! My teacher has me watching them!
I always wondered what signed unsigned meant. Thanks.