Variables in C++

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 440

  • @Grand_Priest_Goku
    @Grand_Priest_Goku 4 года назад +751

    "There are very few rules in C++"
    compiler: *"you have 9001 errors in your code"*

    • @xrafter
      @xrafter 4 года назад +8

      9001?
      Wow thats alot

    • @Trueblue4ever559
      @Trueblue4ever559 4 года назад +89

      @@xrafter Indeed, IT'S OVER NINE THOUSAND!!!

    • @xrafter
      @xrafter 4 года назад +9

      @@Trueblue4ever559
      I don't see that amount in my life

    • @TowelGamingHammer
      @TowelGamingHammer 4 года назад +7

      There's no way that can be right!

    • @jojodroid31
      @jojodroid31 4 года назад +25

      *program is literally Hello, World!*

  • @voze1905
    @voze1905 7 лет назад +840

    Jesus christ, the production quality just went through the roof. I really hope that this series gets more attention.

    • @DylanCurzon
      @DylanCurzon 7 лет назад +14

      I know right!

    • @TheCherno
      @TheCherno  7 лет назад +197

      Glad you're enjoying it! It feels much better to be producing higher quality content, much more satisfying :)

    • @NexGenSlayer
      @NexGenSlayer 7 лет назад +24

      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

    • @Bodybuilder900ml
      @Bodybuilder900ml 3 года назад

      No swearing please ⛪️

    • @Bodybuilder900ml
      @Bodybuilder900ml 3 года назад

      No swearing please

  • @patricktorgerson5810
    @patricktorgerson5810 7 лет назад +223

    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!

    • @lewisb8634
      @lewisb8634 7 лет назад +10

      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 :)

    • @MsJavaWolf
      @MsJavaWolf 6 лет назад +19

      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.

    • @abbysabbydoo24
      @abbysabbydoo24 3 года назад +1

      Can you help me in my computer programming class then 😅

  • @sonictimm
    @sonictimm 5 лет назад +203

    "There are very little rules in C++"
    ...Until you start pushing your code to the company repo.

    • @47Mortuus
      @47Mortuus 4 года назад +25

      Sorry, didn't know your company is a part of C++

  • @resantic2256
    @resantic2256 7 лет назад +347

    Lmao, even got logo on the pillow

    • @bruhdabones
      @bruhdabones 5 лет назад +8

      Resantic It’s so bright, I almost think it’s edited in

    • @Galiskaend
      @Galiskaend 4 года назад +3

      Automamada

  • @Hellbending
    @Hellbending 9 месяцев назад +2

    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 ❤

  • @mytech6779
    @mytech6779 7 лет назад +82

    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)

    • @GfastGao
      @GfastGao 6 лет назад +12

      not just because you are on your last bit => Got it.

  • @davidthorvaldsen8903
    @davidthorvaldsen8903 Год назад +4

    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

  • @theturtlepwn
    @theturtlepwn 5 лет назад +19

    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.

    • @TheHuggableEmpire
      @TheHuggableEmpire 2 года назад +1

      It's definitely the "only difference is size" part that gave that vibe 😁😁

  • @manfromtheoutside7227
    @manfromtheoutside7227 7 лет назад +66

    You have a differnt way to teach, it make learning cpp possible for me. Peace

  • @jamesmnguyen
    @jamesmnguyen 7 лет назад +3

    This video was great. It covered the basics as well as common pitfalls like compiler specific sizes.

  • @amrojjeh
    @amrojjeh 7 лет назад +6

    I have never seen programming explained like this. you did a perfect job as teaching.

  • @dorillo765
    @dorillo765 5 лет назад +13

    Dude you're making c++ possible to understand. Thank you!

  • @mixchief
    @mixchief 4 года назад +22

    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.

  • @theshedman
    @theshedman 5 лет назад +1

    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.

  • @PROTOTYPZ
    @PROTOTYPZ Год назад +3

    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.

  • @wz5445
    @wz5445 4 года назад +2

    the signed and unsigned make so much sense here!!! Thank you The Cherno!!!

  • @jp-cy1hi
    @jp-cy1hi 7 лет назад +3

    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!

  • @jagdishannepu7179
    @jagdishannepu7179 2 года назад +2

    I am glad I found your channel...
    I wish any of my professors were into explaining us so patiently and selflessly.
    Thankyou brother!

  • @jairambhardwaj716
    @jairambhardwaj716 4 года назад +3

    You gave me the utmost clarity of variable ❤🙏

  • @MarshmallowMadnesss
    @MarshmallowMadnesss 7 лет назад +6

    This totally expanded on what I've read in my self-teaching. Thanks!

  • @amp2amp800
    @amp2amp800 4 года назад

    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.

  • @drulli1
    @drulli1 4 года назад +2

    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!

  • @dorothyglade9087
    @dorothyglade9087 5 лет назад +8

    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!

  • @general9064
    @general9064 4 года назад

    This Cherno c++ series is all I wanted to understand about c++. Cannot thank you enough. The clarity in your explanation is exceptional.

  • @w3w3w3
    @w3w3w3 5 лет назад +3

    Got this series linked on a subreddit. Best thing ever. Thanks;

  • @gameplayyt504
    @gameplayyt504 4 года назад +3

    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!

  • @jasonzhang5755
    @jasonzhang5755 Год назад +2

    Need to say that this C++ series is amazing. Love it. Please keep doing it. Many thanks!

  • @viatori5566
    @viatori5566 4 года назад +3

    It is night and day following along with these videos after taking a c programming class.

  • @Sturm14
    @Sturm14 4 года назад +2

    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.

  • @ZeinFakhreddine
    @ZeinFakhreddine 7 лет назад +50

    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++

    • @MrAlbinopapa
      @MrAlbinopapa 7 лет назад +15

      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.

    • @TheCherno
      @TheCherno  7 лет назад +43

      Yep, I'm going to make sure that video is absolutely perfect before I put it up

  • @caioHenrique-jg9my
    @caioHenrique-jg9my 6 дней назад

    This is the best programming language tutorial I have watched in a long, long time. What a man right there!

  • @krec348
    @krec348 7 лет назад +6

    Absolutely fantastic! You explain it so well, please.. PLEASE keep doing them and a big thanks!

  • @timetolearn5523
    @timetolearn5523 7 лет назад +9

    Wow! I think it is the best video that I have ever seen about variables, very well explained. Thanks for your videos!

  • @somewhere7565
    @somewhere7565 6 месяцев назад

    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 :)

  • @fastcomputer5927
    @fastcomputer5927 3 года назад +2

    Probably the best c++ tutorial series ever

  • @trentonclark222
    @trentonclark222 6 лет назад +1

    Undoubtedly the best C++ variables tutorial out there. Keep it up.

  • @tannerbeez
    @tannerbeez 7 лет назад +4

    Yan, I love the production value of this series, it really makes you look professional. Great job man, love the series

  • @nooruddin7721
    @nooruddin7721 3 года назад +4

    you has made able to understand what we want learn and probably you have taught us more...

  • @jtfrench80
    @jtfrench80 4 года назад +2

    My second time through the series so much information I am still learning new things.

    • @samdavepollard
      @samdavepollard 4 года назад +1

      totally agree
      Kind of amazed at how much extra I'm getting from a 2nd viewing

  • @cweasegaming2692
    @cweasegaming2692 4 года назад +2

    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!

  • @shantanuvarma
    @shantanuvarma 6 лет назад +4

    I m in love with c++ , thanks cherno !!!

  • @codyverdes3289
    @codyverdes3289 5 лет назад +3

    Thanks so much for making these videos. They're insanely helpful.

  • @Plasticcaz
    @Plasticcaz 7 лет назад +3

    This looks like it's going to be a great series.

  • @a1988ditya
    @a1988ditya 4 года назад +2

    Quality playlist , content which is never shown in other similar courses

  • @nahiandev
    @nahiandev 5 лет назад +29

    I'm tempted to learn C++ again watching this series. This is masterpiece.

    • @forhadrh
      @forhadrh 3 года назад

      I know you from Quora! ;)

  • @omeletotheegg
    @omeletotheegg 3 года назад

    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

  • @allenguan6755
    @allenguan6755 4 года назад +2

    the quality of this video is OMG !!!! Very deep content!!! I love bro!! thx for ur teaching!

  • @keven444
    @keven444 7 лет назад +3

    Really love the new format of these videos!

  • @epiphanmushahwar6671
    @epiphanmushahwar6671 4 года назад

    i'm fairly confident i could watch this without audio and understand what your saying from your hand movements it's actually quite mesmerizing

  • @HassanSani
    @HassanSani 6 лет назад +20

    You just turned a whole CS semester into an ABC kindergartner class, Thank You

  • @UnhungSign
    @UnhungSign 3 года назад +1

    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!

  • @pradeeplanka6976
    @pradeeplanka6976 5 лет назад +3

    Thanks a lot. Like your compiler video this one too taught me lot of stuff. Very well compiled information.
    Great work.

  • @mdksmarthome9191
    @mdksmarthome9191 Год назад

    This is the best series for C++ for now. Thank you from morocco ♥

  • @muhd_hafizudeen
    @muhd_hafizudeen 6 лет назад +13

    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.

  • @marcelabend7857
    @marcelabend7857 3 года назад +1

    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).

  • @Chevifier
    @Chevifier Год назад +13

    I love how this was five years ago and the production feel like this year. Just decided to learn c++

    • @Asiamirza427
      @Asiamirza427 Год назад +2

      Yup... just wow

    • @Voskos
      @Voskos 5 месяцев назад +1

      how is this going

    • @Chevifier
      @Chevifier 5 месяцев назад

      @@Voskos let's just say I've jumped into the rabbit hole, learning about the Vulkan Renderer API😅

  • @tangzhuang8664
    @tangzhuang8664 Год назад

    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.

  • @cancetin2652
    @cancetin2652 3 года назад +2

    Thank you for this lesson

  • @subliminalcastillo2126
    @subliminalcastillo2126 4 года назад

    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.

    • @subliminalcastillo2126
      @subliminalcastillo2126 4 года назад

      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.

    • @subliminalcastillo2126
      @subliminalcastillo2126 4 года назад

      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#.

    • @subliminalcastillo2126
      @subliminalcastillo2126 4 года назад

      @Artem Katerynych Ohh okay. That makes a lot more sense.

  • @leixun
    @leixun 4 года назад +5

    *My takeaways:*
    Define variables using pointers and references 12:30

  • @abhimanyuattrish
    @abhimanyuattrish 5 лет назад

    Best youtube channel for c++ and game dev

  • @GfastGao
    @GfastGao 6 лет назад +1

    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.

  • @viktor_borodin
    @viktor_borodin 3 года назад

    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.

  • @MrSmileyFella2
    @MrSmileyFella2 4 года назад +1

    Got finals tomorrow online during this lockdown and I dont have a textbook or anything, so this really helps. thank you.

  • @faeldaug9719
    @faeldaug9719 4 года назад +2

    I'm so glad I found this channel! I want to learn game development and you're helping me so much!

  • @BlackJar72
    @BlackJar72 7 лет назад +2

    Great series -- I can't wait for the intermediate and advanced stuff. :-)

  • @vedantchaudhari7123
    @vedantchaudhari7123 5 лет назад +59

    damn! every freaking time i look up your name the freaking chernobyl disaster comes up scary af

    • @SantiRodriguezRuiz
      @SantiRodriguezRuiz 5 лет назад +14

      "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.

    • @DheerajAeshdj
      @DheerajAeshdj 4 года назад +1

      @@SantiRodriguezRuiz thanks wiki

  • @musikk7521
    @musikk7521 7 лет назад +1

    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 :)

  • @MartinBarquero95
    @MartinBarquero95 3 года назад +1

    Thanks for the hard work on teaching

  • @TheSim00n
    @TheSim00n 7 лет назад +2

    136 up, 0 down. That's telling of good this series is. Keep it up!

  • @emanuel3617
    @emanuel3617 Год назад +3

    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.

  • @extonsthelock7389
    @extonsthelock7389 7 лет назад +7

    I'm here ... i love this series

  • @Sharess
    @Sharess 7 лет назад

    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++

    • @MrAlbinopapa
      @MrAlbinopapa 7 лет назад

      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.

    • @musikalniyfanboichik
      @musikalniyfanboichik 3 года назад

      @@MrAlbinopapa i'm a bit too late, but thanks anyway x)

    • @MrAlbinopapa
      @MrAlbinopapa 3 года назад

      @@musikalniyfanboichik yeah, I'd say 3 years is a bit late, but no worries. Looks like I was just promoting my favorite RUclips creator.

  • @utsavdahiya3729
    @utsavdahiya3729 4 года назад +2

    9:56 bool stands for bullying! Nice generated captions

  • @PANKAJGUPTA-cm7zg
    @PANKAJGUPTA-cm7zg 4 года назад +1

    Once again ... Full of energy ... Thanks for the video .. Love from India.. :)

  • @nacl3470
    @nacl3470 6 лет назад

    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.

  • @xyzcarlatino
    @xyzcarlatino 6 лет назад +1

    Great videos! I am definitely going to support the channel

  • @shazer4991
    @shazer4991 7 лет назад +1

    Love this series

  • @itamar-jr-tech
    @itamar-jr-tech 7 лет назад +14

    Que didática sensacional!

  • @suhdongbin8248
    @suhdongbin8248 6 лет назад +1

    You literally are a great teacher of C++

  • @allmertalex
    @allmertalex 7 лет назад +2

    I'm studying C from a book called Learn C the Hard Way, you're essentially teaching C here since this applies there too.

  • @m96fa40
    @m96fa40 9 месяцев назад

    As an intermediate C++ programmer, you explained this impressively!
    You are a really amazing teacher, Yan. 👏👏

    • @siman211
      @siman211 8 месяцев назад

      Hey i am new to programming is this playlist enough to learn c++ or should i try with a udemy course or book?

    • @m96fa40
      @m96fa40 8 месяцев назад

      ​@@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.

  • @jamesfox8930
    @jamesfox8930 6 лет назад

    best c++ videos ever man thank you brogami

  • @KamilKhanYT
    @KamilKhanYT 4 года назад +2

    The difference between him and others is that he actually describes WHY things need to be done a certain way.

  • @diskdoctorprague
    @diskdoctorprague 3 года назад

    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.

  • @rogerpenrose1368
    @rogerpenrose1368 2 года назад

    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.

  • @mistervoldemort7540
    @mistervoldemort7540 7 лет назад +23

    I'm dissapointed, he didn't do "VROOOM" at the end

  • @pwrdwnsys
    @pwrdwnsys 7 лет назад +2

    Great series. thank you!

  • @backbenchersfactory
    @backbenchersfactory 11 месяцев назад

    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🇮🇳

  • @tannishkmankar3998
    @tannishkmankar3998 2 года назад

    This tutorial is amazing and you are really good at teaching !! great job sir !

  • @minecastminecraft
    @minecastminecraft 7 лет назад

    Very useful for reviewing variables for C++

  • @iamjovani
    @iamjovani 7 лет назад +4

    Keep up the good work bro!

  • @saeedahmedsheikh231
    @saeedahmedsheikh231 6 лет назад

    Incredible way of teaching
    I m so inspired
    Keep on dear.....

  • @Bloglalo
    @Bloglalo 3 года назад

    I love you Yan, this series is a masterpiece!

  • @팍준하
    @팍준하 4 года назад

    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

    • @xrafter
      @xrafter 4 года назад

      But 'a' is not 65
      'A' is 65

  • @asdsd-wu4yw
    @asdsd-wu4yw Год назад

    amazing explanatoion in short and crisp manner in thi entire world

  • @rdwells
    @rdwells 2 года назад +1

    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

  • @ericsankey5756
    @ericsankey5756 2 года назад

    Hey thanks for these videos! My teacher has me watching them!

  • @georgeallen7487
    @georgeallen7487 7 лет назад +2

    I always wondered what signed unsigned meant. Thanks.