tag:blogger.com,1999:blog-8031110345574103493.post3182647192229627099..comments2023-10-23T08:48:16.784-07:00Comments on Learn C++: C++ style castsPranit Kotharihttp://www.blogger.com/profile/07243667541835995174noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8031110345574103493.post-72351300135311011092018-08-11T00:04:07.656-07:002018-08-11T00:04:07.656-07:00Nice answers in replace of the question with real ...Nice answers in replace of the question with real point of view and explaining about that.<br /><a href="https://www.tutorialcup.com/cplusplus" rel="nofollow">learn c++</a> <br />Clairehttps://www.blogger.com/profile/04565520154551295066noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-5761580458075742952017-05-15T10:19:30.078-07:002017-05-15T10:19:30.078-07:00Thanks for learning english homedawgThanks for learning english homedawgBloggerJohnhttps://www.blogger.com/profile/09798236419258436746noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-12599843599163081092017-05-15T10:18:56.962-07:002017-05-15T10:18:56.962-07:00Oscars are for acting. This article is too legit f...Oscars are for acting. This article is too legit for that. BloggerJohnhttps://www.blogger.com/profile/09798236419258436746noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-20820203134473054852016-06-11T23:00:03.637-07:002016-06-11T23:00:03.637-07:00Thanks... Very Useful Post!!Thanks... Very Useful Post!!Anonymoushttps://www.blogger.com/profile/14752094450525665171noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-48526194689599534142016-06-04T02:33:42.898-07:002016-06-04T02:33:42.898-07:00You deserve Programming Oscar for your intuitive a...You deserve Programming Oscar for your intuitive article.Anonymoushttps://www.blogger.com/profile/03144161249607332075noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-51406139037534911942013-12-09T21:18:39.109-08:002013-12-09T21:18:39.109-08:00Casting do not effect variable you are casting on....Casting do not effect variable you are casting on. It just change expression's type. Say you have constant variable, you cannot assign address of const variable to non const pointer, so here you use const cast, type of actual variable is not changed, but it can be assigned to const pointer.Pranit Kotharihttps://www.blogger.com/profile/07243667541835995174noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-49995675864976271802013-12-09T21:02:52.511-08:002013-12-09T21:02:52.511-08:00Article was nice but in const_cast i dint underst...Article was nice but in const_cast i dint understand,const_cast means we can change the value of const variable ex: suppose we have const int a=10<br />by using const cast we can increment or decrement the value what u did i did not understand<br />Anonymoushttps://www.blogger.com/profile/10172917981836358688noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-78970007900309053592013-11-10T18:00:49.942-08:002013-11-10T18:00:49.942-08:00Thanks for your inputs.Thanks for your inputs.Pranit Kotharihttps://www.blogger.com/profile/07243667541835995174noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-16672997217593553022013-11-09T10:44:32.934-08:002013-11-09T10:44:32.934-08:00Greap post! One thing that you could mention is th...Greap post! One thing that you could mention is that the C++ standard defines the C-style cast in terms of combinations of C++ casts. Here's an excerpt from section 5.4.4:<br /><br />"The conversions performed by<br />— a const_cast,<br />— a static_cast,<br />— a static_cast followed by a const_cast,<br />— a reinterpret_cast, or<br />— a reinterpret_cast followed by a const_cast,<br />can be performed using the cast notation of explicit type conversion."<br /><br />In other words, the compiler will try and pick one of the above sequences of casts, to carry out the C-style cast. If you make a mistake with a C-style cast, and the compiler manages to find a combination of casts that works, there will be no compile error. By using explicit C++ casts, you can strictly enforce what you need.<br /><br />In addition, dynamic_cast is never used in C-style casts, so that's another danger.Alexander Kondratskiyhttps://www.blogger.com/profile/07838752819816217099noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-81466170284218139902013-08-29T20:31:44.363-07:002013-08-29T20:31:44.363-07:00Thanks Rafael.Thanks Rafael.Pranit Kotharihttps://www.blogger.com/profile/07243667541835995174noreply@blogger.comtag:blogger.com,1999:blog-8031110345574103493.post-88786687108783440682013-08-29T14:46:20.756-07:002013-08-29T14:46:20.756-07:00Very easy and fun to reading, from my point of vie...Very easy and fun to reading, from my point of view the difference between static_cast and dynamic_cast was confusing util i read your blogAnonymoushttps://www.blogger.com/profile/11390881288045041793noreply@blogger.com