Casting in C++

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 179

  • @naoufal450
    @naoufal450 6 років тому +111

    After watching accidentally a video of yours, I found you an awesome teacher and I've completed the whole series in a matter of days, never gets boring.
    You really motivated me to seriously learn this language (I did know most basic things but was lazy and stopped), I hope you continue doing videos, trust me it's going to be a very valuable library.

  • @jaesiraki84
    @jaesiraki84 3 роки тому +28

    Such a modest energy and I can actually understand what you're saying. Thanks!

    • @MaySmithereen
      @MaySmithereen 2 роки тому +1

      Some people explain in a very gate-keeper type of way :( Really glad people like him exist!

  • @leixun
    @leixun 4 роки тому +53

    *My takeaways:*
    1. Implicit and explicit casting - C style 1:53
    2. Static cast - C++ style 4:15
    3. Why we want to use C++ style cast 4:44
    4. Dynamic cast - C++style 8:44

  • @KostasOreopoulos
    @KostasOreopoulos 5 років тому +44

    static_cast also helps to avoid removing constantness that can be easily done through c-style casting

    • @hammielover225
      @hammielover225 3 роки тому +1

      @Ameer Leonel BOT

    • @hammielover225
      @hammielover225 3 роки тому +1

      @Jon Anderson bot?

    • @fppt1555
      @fppt1555 3 роки тому +1

      @@hammielover225 Yes these always come in pairs, one claims to hack his gf's/sister's Instagram, and the other says he'll try it out.

    • @hammielover225
      @hammielover225 3 роки тому +2

      @@fppt1555 I know that

  • @itsmaxim01
    @itsmaxim01 Рік тому +4

    another drawback of (C)style casts is that they will attempt every cast type until one works, meaning the result won’t necessarily be what you expect

  • @kurt7020
    @kurt7020 2 роки тому +2

    "The compiler has looked at that and been like - that's never gonna work." - Sounds like most of my code. XD

  • @chinmaydas4053
    @chinmaydas4053 6 років тому +21

    Sir, now We need more advanced c++ series from a great guy like you,many many thanks👍🙏🙏..

  • @sonulohani
    @sonulohani 6 років тому +141

    You explain very well. And youre the only one who doesn't use mac book.

    • @groberti
      @groberti 6 років тому +13

      He is the only C++ programmer who does not use a mac? It should not matter anyway :)

    • @lukedk4614
      @lukedk4614 4 роки тому +14

      @@groberti It does matter once you get into platform specific implementations. Obviously someone in a mac won't use things like the Win32 or DirectX / Direct3D (well not officially anyways). But yeah, for this topic specifically it doesn't matter.

    • @groberti
      @groberti 4 роки тому +3

      @@lukedk4614 Well, obviously. Or you could use a cross-platform framework (like OpenGL) and then it does not matter as much. The op is not explicit enough btw, are most other people who teach C++ use Mac or do programmers in general? I do think that the Mac is the most convenient platform if you are developing "platform independent" things or if you're developing for the Mac. Or even if you are developing for multiple platforms, but then you'll need another computer with Windows / Linux as well anyway

    • @smileynetsmileynet7922
      @smileynetsmileynet7922 4 роки тому +3

      @@groberti He's not the only one that doesn’t use a MacBook. Lots of people dont use them. For me, they are simply too expensive. But I use both Windows and Linux all the time.
      Now, for the bleeding edge, Linux is the one that gets features first for my languages, such as PNF.

    • @FedJimSmith
      @FedJimSmith 2 роки тому +1

      @@groberti he's a game developer and the game he develops run on windows not mac or linux, so obviously he will use Visual Studio on Windows

  • @xonxt
    @xonxt 5 років тому +7

    I've read somewhere, that it's actually faster and more efficient to use the C++-style casting, because if you use the "old style" casting, the modern compiler will try to attempt every c++-style casting in turn (const -> static -> reinterpret) and return the result of the first successful cast. But if you use one of them explicitly yourself, you just do it directly, without extra steps.

    • @theshermantanker7043
      @theshermantanker7043 Рік тому +4

      It's faster at compile time, not when actually running

    • @ataladin87
      @ataladin87 Рік тому

      @@theshermantanker7043 difference???

    • @oreoisacat6297
      @oreoisacat6297 Рік тому

      @@ataladin87 it will compile faster but when you run it, c style would be faster.

  • @gabrielbraz9669
    @gabrielbraz9669 Рік тому +1

    A example of why would you need to cast something.
    {
    int sum = 27;
    int num = 5;
    double average_1 = sum / num;
    // average_1 = 5
    double average_2 = (double) sum / num;
    // average_2 = 5.4
    }
    Basically, because sum and num are both integers, the c++ will use the integer version of the division operator, and the result will be truncated into an int, before being assigned to the double variable. And in the second case, because of the type casting into a double, the double version of the division is used and the result is expected.

  • @gayusschwulius8490
    @gayusschwulius8490 4 роки тому +2

    It's amazing. I have been using C++ for half a decade and written quite a few rather complex programs, yet there are still features I didn't know, lol.

    • @ahmedbugti3152
      @ahmedbugti3152 4 роки тому

      What makes you use C++ so long?

    • @gayusschwulius8490
      @gayusschwulius8490 4 роки тому +2

      @@ahmedbugti3152 It's just the language I'm most comfortable with. It's also very powerful, versatile and (next to C) de facto industry standard in many areas of software design.

  • @work9167
    @work9167 3 роки тому

    I am happy you make these videos. Because I study Computer Science in my university and it really helps me understand information which I didn't get in my class

  • @syntaxed2
    @syntaxed2 6 років тому +94

    Any chance you can go more indepth with c++?
    E.g Software patterns, observer/subscriber/design/factory etc, how to structure/organise code, superclasses or not, how to achieve loose coupling etc.
    I feel all of this basic stuff has been done, its all over youtube, the horse is not beaten...its a wet pulp at this point :D Just a hint for future content!

    • @groberti
      @groberti 6 років тому +19

      I don't think that those topics are C++ specific. It would be nice to have a new Cherno series dedicated to that but those topics would not fit into this C++ course imho

    • @calmsh0t
      @calmsh0t 5 років тому

      He is right, it is C++ specific since many design patterns cannot be applied directly to c++ since they heavily use concepts introduced in higher level languages

    • @zvxcvxcz
      @zvxcvxcz 4 роки тому +12

      Those aren't things you would usually ask a game programmer. Games are not like many other large projects in this respect, often due to performance targets. Many of these patterns are really geared towards what I will call corporate code... where the assumption is that everyone else using your code is a moron that will ignore comments and abuse absolutely anything that can be abused and in the worst ways possible. Not to say that games don't have any overarching structure, they do. How do I put this though, it's not that they don't have design patterns, but they have different design patterns and they aren't patterns that most proponents of design patterns would approve of.
      Cherno's videos are good and necessary. Tales of the horse's demise are greatly exaggerated. He's pretty much the only person talking about these things on UA-cam that can actually convey them to an audience. He's the only one doing C++ videos that makes me feel like I'm back in my university courses listening to my prof rather than to some moron that either doesn't themselves know what they're talking about or with such poor communication skills that the only people that know what they're talking about are people that already knew the subject matter. Go watch some C++ con vids, none of them seem to be able to define lvalues and rvalues in a way that anyone that didn't already know them can understand. Watch Cherno a few minutes and it makes perfect sense.

  • @redcrafterlppa303
    @redcrafterlppa303 2 роки тому +1

    Implicit casts with data loss is one of the greatest sins of c/c++

  • @Lightn0x
    @Lightn0x 3 роки тому +2

    1:05 implicit conversion can have data loss though, can't it? For instance, implicit conversion from double to int truncates to nearest int.

  • @Solo6R
    @Solo6R 6 років тому +8

    Appreciate the awesome series so far. I still reference your videos when I'm not 100% sure why something works. Anyways.
    REQUEST: Could you do a video on std::string_view vs. std::string, and when to prefer to use one or the other?

  • @MrHelio97
    @MrHelio97 4 роки тому +4

    Although I'm making some effort to learn C++ style casts, I also prefer C-Style casts. The only thing that C++ style casts ( a part from dynamic_cast) have useful is improving code readability, but I see them somewhat confusing. Working with C-Style cast is far easier.

  • @Miketar2424
    @Miketar2424 6 років тому +1

    An important point that I realized looking at my casted variable types, the variables do not actually change to the casted types, only the data is changed. So the variable doubleVar = 5.5, will send 5 when casted as an int, but it still remains a double.

  • @shavais33
    @shavais33 4 роки тому +13

    I feel like someone could learn C++ just as well from this video series as they would from a university computer science class. Just as well, if not better. The value here is just too high to consume in good conscience without proffering some level of support. I think I sense a Patreon subscription in my future.

    • @shavais33
      @shavais33 3 роки тому +1

      @Over Yonder I'm sorry to hear that your university experience was so terrible. At the time when I attended the university I went to, their computer science and computer engineering undergraduate programs were incredibly intensive.

    • @shavais33
      @shavais33 3 роки тому +2

      Oh I think you over state the case against going to university a bit. I can appreciate the sentiment, and you might be right when it comes to learning some particular programming language or something, but the engineering pro school I went through took me through big thick advanced textbooks on math, physics, chemistry, things like quantum mechanics and semiconductor physics. Power dynamics, signals and systems, properties of materials.. Things like calculus based discrete math that describe systems for proving (or disproving) the correctness of algorithms.. Electronics and micro electronics.. I built and programmed embedded systems in machine language, assembler, and then C.. advanced concepts in computer architecture.. I designed and simulated the operation of a microprocessor and used equipment whose output could be put into other equipment that would actually manufacture it.. It took me through the advanced details of operating system internals.. All kinds of things. Way too much to even list. I started with 1,000 peers and graduated with 100. Literally 90% washed out! I am probably upwards of the 96th percentile in terms of intelligence, and I found the program to be very challenging. I would never have learned all that stuff on my own, and I don't think I've really found on-line resources that nearly match all that. I still have a small book shelf full of the those big thick advanced textbooks. To me, the online materials I've come across seem more geared toward people with much closer to average intelligence than that of the audience targeted by my university textbooks. Not that you necessarily need all that stuff just to be a programmer, but. I would say that it doesn't hurt. My perception is that the vast majority of programmers I come across who don't have the kind of education background I have don't really think on same the level that I do. Even the ones who I would guess are actually a little smarter than I am. But again, all that said, I do think when it comes to learning about some particular programming language, you might be right that some online resources, like this one, rival or even do better than 1st or 2nd year university courses.

  • @buddhasarchive8385
    @buddhasarchive8385 4 роки тому

    thanks. great video as always

  • @Katniss218
    @Katniss218 4 роки тому +4

    6:45 How is searching for "(int)" not practical?

    • @SatyajitSatoDas
      @SatyajitSatoDas 4 роки тому +2

      Because you will have to search for all datatypes like that? In case of C++ style cast you will just need to search for 4 types at max.

  • @kgothatsontsane3119
    @kgothatsontsane3119 4 роки тому

    Thank you. You're a legend!

  • @krisitak
    @krisitak 6 років тому +9

    Hello Yan. Can you do a video about CMake, makefiles and their alternatives in Visual studio.

  • @parabalani
    @parabalani 3 роки тому

    I can't believe how accessibly you explained this

  • @exodus8814
    @exodus8814 6 років тому +19

    Hello all. I'm having a hard time understanding pointers, I'm okay with everything else in C++, like classes, structs, templates, polymorphism etc..
    It's just pointers that i don't really understand. For example, why do we use const char* message;? Why does it have to be const? Even without const we still cannot change the contents in message.
    Furthermore, why do we have const char* message and char* const message? How can a pointer be constant? Add to that, what is char** argv or argv[]? Malloc, calloc, realloc, free?? Why should I create a variable on the heap? When? Why? What does it give? Why should I free/delete the variables created on the heap?
    I have soo much in mind, if anyone could help, I appreciate it a lot. Thanks

    •  6 років тому +7

      I think Cherno made a really good video explaining pointers

    • @anandkrishna590
      @anandkrishna590 6 років тому +1

      The thing you forgot is this is CPP. Ok i will agree that's cringy. For tips I'm a newbie so I'll just recommend you watch all his vids on cpp and others too. Dont take my word for it though.

    • @exodus8814
      @exodus8814 6 років тому +7

      Nikola Kostić Thank you very very much for that detailed answer! I appreciate it, sorry if this was too much, I come from high level languages so the concept of pointers and low level stuff is pretty confusing, I tried googling questions and I actually found answers, but still the concept was pretty hard to grasp.
      Thanks a lot for your time :)

    • @haxterhuz8346
      @haxterhuz8346 6 років тому +4

      I would suggest a book called Effective C++. Its really good

    • @owiley2002
      @owiley2002 6 років тому

      The idea behind pointers isn't really a new concept. Think about everyday interactions. Let say that your love one like a grandma wants to give you a present. One way is to visit you directly and give you the present. This is sending you a value directly. But what if I she cannot directly visit you? The next way is sending it via mail or by some address. This is exactly what pointer does. A pointer is a variable which holds data that is the address of something. Your grandma probably has and address book that holds this information and other things like maybe a birthday tracker or planner. The idea is to be able to store a reference to some location becomes key in computing. Some things can not be loaded all at once on a computer, so knowing where it is located becomes very important. The heap vs stack is away to address this problem by having some promises that at least this much information can be seen at once. Later on you will come to see that certain things do not physically exist as limitation but are abstracted ideas that are imposed on the system of computing.

  • @NeoKailthas
    @NeoKailthas 3 роки тому +5

    If I type very strongly, does that make me a good cpp dev?

  • @ChillerDragon
    @ChillerDragon 6 років тому +11

    What shortcuts do you use to code that fast? It looks like your using vim instead of visual studio hehe. Would be nice to see a video about that.

  • @SankoshSaha_01
    @SankoshSaha_01 4 роки тому

    any game engine with C++ is gonna give hell with this casting

  • @GGSHANE-u9k
    @GGSHANE-u9k Місяць тому +1

    but is casting necessary? am here looking at code initialized with static_cast.

  • @SUST-RWM
    @SUST-RWM 3 роки тому

    static_cast - compiler time conversion check
    dynamic_cast - runtime conversion check

  • @mattiamarchese6316
    @mattiamarchese6316 2 роки тому

    At 3:56 you can see Visual Studio transforming that 5.3 in 5.29999999999999

  • @redwing8725
    @redwing8725 4 роки тому

    Thanks a lot, your videos are always the easiest to understand :)

  • @darthnegativehunter8659
    @darthnegativehunter8659 4 роки тому

    8:20 , no actually your explanation was perfect and very understandable. thank you

  • @Medak1337
    @Medak1337 6 років тому +2

    you make cool videos, keep it up

  • @ainoakeisari
    @ainoakeisari 8 місяців тому

    I learned everything about casting from this video except why we need casting and what does it do. Like what is a static_cast?

  • @erikeviston
    @erikeviston 5 років тому +1

    Any updates on the dynamic casting video? Really interested in this as well as further information on RTTI and reflection in C++. Not something that is clearly and concisely explained online! Thank you for all your helpful videos.

  • @kamran_aghlami
    @kamran_aghlami 6 років тому +16

    ahhh nice one! I was hoping to see another OpenGL video though. ;)
    keep them coming!

    • @pooria_garrett3020
      @pooria_garrett3020 6 років тому +1

      Hey man are you in Cherno discord server? come join us.

    • @kamran_aghlami
      @kamran_aghlami 6 років тому +1

      Pooria GH I just created my acc on discord, aaaand seems like i’ve been missing this one. 👌

  • @ultimatesoup
    @ultimatesoup Рік тому

    Just a note, but you should prefer '
    ' over endl. Endl also performs a flush which makes it orders of magnitude slower.
    Another small correction, c style casts cannot perform dynamic cast behavior. It can do all the other types though. You should never const cast. Some people use it to add const to variables but a better way is to just use std::as_const

  • @leonardomarinovic3492
    @leonardomarinovic3492 6 років тому

    So many oportunities to fuck up.

  • @joseponce6250
    @joseponce6250 3 роки тому

    thanks

  • @yashratnani9877
    @yashratnani9877 4 роки тому

    thank you

  • @yayaskurt
    @yayaskurt 6 років тому +2

    Hey, would you make a video explaining object slicing?

  • @pablo17349
    @pablo17349 2 роки тому

    Hi Cherno! I am currently studing at 42 school, and your videos are so helpfull. So you know!

  • @cmdlp4178
    @cmdlp4178 6 років тому +1

    What about std::any_cast :D. (It is not an operator, just a function to cast a std::any in the new standard-library features.)

  • @sumitparwal4086
    @sumitparwal4086 3 роки тому

    can you explain about inheritance in nested class as in can the classes inherited by enclosed class will also be inherited by nested class if not how can we include them

  • @stewartzayat7526
    @stewartzayat7526 6 років тому +2

    Could you make a video about memory allocators, like memory arenas?

  • @vivekshivhare8820
    @vivekshivhare8820 Рік тому

    Can you make a series on design patterns?

  • @Spiderexe
    @Spiderexe 5 років тому +1

    the reinterpret_cast at 7:50 doesn't work for me. other than that, great video :D

  • @jaywalkingly
    @jaywalkingly 5 років тому

    thank you for this video

  • @_juanzu_
    @_juanzu_ 4 роки тому

    Thanks ♥️

  • @SkSafowan
    @SkSafowan 2 роки тому

    please make another video about how to understand this video !!!

  • @footballCartoon91
    @footballCartoon91 4 роки тому

    Man
    I need your help,
    I want to cast an int variable of an array into string or bool or maybe a constant number.
    i.e
    int *arrayPointer=new int[ 5 ];
    Then i want to just represent the *arrayPointer in smaller byte size,
    Because later I would like to check whether the user input insert the correct number in the correct order.
    This can be used to create a new programming language!
    Thanks

  • @slayer5171
    @slayer5171 6 років тому +3

    Hello, would you make a video about exception and exception handling?

  • @snookiewozo
    @snookiewozo 4 роки тому +2

    A very chaotic video.

  • @tlhomotsemoteme2423
    @tlhomotsemoteme2423 6 років тому

    You are the best!

  • @tianhepeng9162
    @tianhepeng9162 6 років тому

    Where is the in-depth dynamic_cast video? I find information from cppreference is so hard to understand. Hope the dynamic_cast video would come ~

  • @joeydicastro
    @joeydicastro 6 років тому +1

    Const cast removes const from memory, this only works with pointers:
    const int* constValue = new int(5);
    int* nc = const_cast(constValue);
    *nc = 7;
    cout

  • @mrboyban
    @mrboyban 3 роки тому

    Cherno you're a trouble mate.! Very a few people can type on a suit, good stuff! thanks

  • @catomajorcensor
    @catomajorcensor 3 роки тому

    C++ is not strongly typed, it is very much weakly typed("if (3)"), but it is statically typed.

  • @jannesopanen8032
    @jannesopanen8032 3 роки тому

    Hey do you use laptop's internal mic or do you have external one ?

  • @michael541
    @michael541 Рік тому

    Do you know what native advertising is?))

  • @funera3385
    @funera3385 5 років тому

    thank you alot
    you helped me alot

  • @valizeth4073
    @valizeth4073 6 років тому

    Could you answer why you need to typecast the C function malloc?
    like
    char* ptr;
    ptr = (char*)malloc(size * sizeof(char)); ??

    • @TheSiddh123
      @TheSiddh123 6 років тому +2

      I guess because malloc returns a (void *) , also malloc does not know for which type we are allocating memory for so we have to cast it back ( size is provided using sizeof(type) , in your case its sizeof(char))

    • @valizeth4073
      @valizeth4073 6 років тому

      I know how you use malloc to allocate sizes and so on, just didn't get the casting.

    • @joshs2475
      @joshs2475 6 років тому +1

      +Vali Zeth - C++ has more type safety than "C". "C" doesn't care what type you assign a void pointer (void*) to, so you could assign a void pointer to anything without it caring, but C++'s extra type safety needs you to explicitly tell the compiler what type you want the void pointer casted to, because a void pointer is a pointer to anything (unknown type)...

    • @valizeth4073
      @valizeth4073 6 років тому

      One thing I still haven't gotten though is why pointers are of type void. A pointer returns a memory address of an object / variable. The address is still a value though, void = emptiness. So how can it return an adress and yet nothing at the same time?

    • @joshs2475
      @joshs2475 6 років тому

      +Vali Zeth - A void pointer is just a RAW Address.
      It is basically like saying, that whatever receives this pointer can treat the memory space at that address as any type it would like.
      So if I cast a void* to a char* ("char* ptr = (char*)malloc(10)"), I'm just telling the compiler that i want to either read or write to this address as the value type of "char" (1 byte data type).
      I could also say I can cast the void* to a int* ("int* ptr = (int*)malloc(10)"), I'm telling the compiler that I want to either read or write to this address as a value type "int" ( 4 byte data type)
      So as you can see, i can treat a void* as anything I want due to the fact that the compiler doesn't actually know what is at that address because it is a pointer to an "Unknown data type" (void*)...

  • @sirfalcon1
    @sirfalcon1 6 років тому

    Do you have a video on Try Catch error handling?

  • @GenjaOrigins
    @GenjaOrigins 3 роки тому

    Videos of HashMap HashSet etc please

  • @poganka45
    @poganka45 6 років тому +2

    you're the modern day superhero!

  • @obinator9065
    @obinator9065 6 років тому

    Can you do a video on iterators?

  • @vertigo6982
    @vertigo6982 5 років тому +16

    06:42
    Nobody:
    Vim users: "Hold my beer"
    see that.. 2 memes in 1.

  • @pepesilvia3776
    @pepesilvia3776 2 роки тому

    bruh, that decor is nasty af.

  • @ikefir
    @ikefir 5 років тому

    Hi! Though I’m kinda late to the party, let me ask - what is your opinion on “warning: use of old-style cast”? And thanks for the content. Keep it coming!

  • @christomaliyekkal8381
    @christomaliyekkal8381 6 років тому +2

    Could you please add tutorials on websocket? Create websocket services using C++, Websocket client, etc.

  • @cavidanbagiri1884
    @cavidanbagiri1884 6 років тому

    hi Cherno. why dont you create c++coursein udemy. please create course and speak about c++ and mysql connection and some function. Thank you very much

  • @gabrielbarrantes6946
    @gabrielbarrantes6946 Рік тому

    Is casting a good practice? I feel is so dirty that should only be done if you are looking to implement something not readable but quite efficient like que quake algorithm lol

  • @andrez383
    @andrez383 Рік тому

    Cherno, you should have used a black couch for this episode :)

  • @pnuema1.618
    @pnuema1.618 2 роки тому

    The word "static" always refers to "compile time"

  • @dominikvereno8404
    @dominikvereno8404 6 років тому

    Would be awesome if you could make a video about regular expressions!

  • @darklord3227
    @darklord3227 5 років тому

    I have been programming in c++ professionally for a long time. Yet I still enjoy your videos! I mainly watch them for features that I don't normally use. I was wondering if you could create an episode on crash debugging. Thanks!

  • @samkenneth6251
    @samkenneth6251 6 років тому

    Are you going to do more Sparky episodes??

  • @kamendolievaleksandar233
    @kamendolievaleksandar233 6 років тому +1

    Make video about dynamic cast asap!

  • @osere6432
    @osere6432 5 років тому

    Bit fields please?

  • @michaltch9246
    @michaltch9246 6 років тому

    Can u please make video about filling code with module tests? Using boost c++ libraries.

  • @connorhorman
    @connorhorman 6 років тому

    I think that not everything can be done with a c-style cast. If x is an int or an int&, I can static_cast it to int&&, but do (int&&)x. (can't convert an lvalue expression to an xvalue, but static_cast can transform types from an lvalue to an xvalue. (Though not directly to a prvalue.)

  • @haxterhuz8346
    @haxterhuz8346 6 років тому +2

    Hey Cherno can you do a series on making an interpreter or compiler for a toy language?

  • @fidanrli7456
    @fidanrli7456 6 років тому

    Hi could you explain inline function ?
    and storage class?
    These are my exam questions .

  • @sbn0671
    @sbn0671 6 років тому

    Hi guys! I have trouble with glsl shading language. I use #version 120 because of my hardware. I've tried inverse function for lighting but i can't use it. It needs minimum #version 150. Is there other option than using inverse function?

  • @zikdoz
    @zikdoz 6 років тому

    Isn't it better to check for nullptr instead of regular 0 (or NULL macro) with dynamic casts?

    • @jamesmnguyen
      @jamesmnguyen 6 років тому +2

      zikdoz
      Quick answer: no
      Long answer: Nullptr means, just that, a null pointer. So checking a pointer with nullptr makes sense.
      Technical answer: it doesn't matter, but you'll lose friends.

    • @jamesmnguyen
      @jamesmnguyen 6 років тому +1

      itsArtem
      The first example shows what's going on in memory, the second shows what you're trying to do.

  • @garageman2236
    @garageman2236 3 роки тому

    Syntax sugar!

  • @ridaennasry2558
    @ridaennasry2558 2 роки тому

    "C-style cast can achieve of all that so this isn't really adding new functionality i's kind of syntax sugar to your code" that's absolutely a wrong statement, C++ casts add many functionalities, for example static_cast is more restrictive and does compile-time checking for valid casts hence you can't cast pointers which point to different data types in c++ static_cast, while in c-style you can, you can't too take the constness off a type using c++ static_cast while in c you can, and for other c++ casts they add their functionality too, do you readings !!!!!!!!

  • @crait
    @crait 2 роки тому

    Yeah, you can search for casting without static_cast if you use the constructor-style casting.

  • @AntiWanted
    @AntiWanted 3 роки тому

    Nice

  • @sushant_
    @sushant_ 6 років тому

    Which softeware are you using for this programming?

  • @joeydicastro
    @joeydicastro 6 років тому

    Guys, do you know about a C++ developers group? on any social network, I´m really interested on become part of one since I enjoy C++ a lot, and I want to learn from others and also share knowledge.

  • @bloodwolf8307
    @bloodwolf8307 4 роки тому

    cool

  • @Alonedream15
    @Alonedream15 6 років тому

    We want video about cmake & llvm plese . What are thay?

  • @dockstaal7110
    @dockstaal7110 6 років тому

    lol I was just learning about this for my exams and now you upload a video about it.

  • @GohersWay
    @GohersWay 4 роки тому

    7:47

  • @Beatsbasteln
    @Beatsbasteln 4 роки тому +3

    did anyone notice that he is at different places in almost every video? how does he even do that?

  • @dms2472
    @dms2472 6 років тому

    Next , videos about shortcat typing for more productive coding pliss

  • @erwinschrodinger2320
    @erwinschrodinger2320 3 роки тому +1

    Amazin.

  • @bextract0
    @bextract0 6 років тому

    yeeeeeeeeeeeeeeeeeeeeeeeeeet