Тёмный

CONSTANTS in C++ 

cazz
Подписаться 145 тыс.
Просмотров 26 тыс.
50% 1

Constants in modern C++ can be quite confusing... in this video we will talk about the 4 constant related keywords in C++ and what they do. Please enjoy!
💎 Source code is available for my Patrons!
/ cazzwastaken
💎 Join our community over on Discord!
/ discord
→ GitHub: github.com/cazzwastaken
→ Instagram: / cazzwastaken
→ Twitter: / cazzwastaken
→ Email: cazzwastaken@gmail.com
→ PayPal: www.paypal.com/donate/?hosted...
🕙 Timestamps 🕙
0:00 introduction
0:42 what are constants
1:24 const keyword
2:40 constexpr keyword
6:08 consteval keyword
7:08 constinit keyword
⚡See More ⚡
→ Glow: • INTERNAL CS:GO GLOW ES...
→ Chams: • REAL CSGO CHAMS - DRAW...
→ CreateMove: • Hook CreateMove From S...
→ Internal Menu: • IMGUI INTERNAL DIRECTX...
→ Aimbot: • MAKE AIMBOT IN 10 MINUTES

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 117   
@BiteYt69
@BiteYt69 2 года назад
I need a full advanced c++ course from this guy, my guy cazz got damm god level teaching skills
@cazz
@cazz 2 года назад
I appreciate it man!!
@arvindh4327
@arvindh4327 Год назад
+1
@volcanhacks
@volcanhacks Год назад
@@cazz you really need to do this I have been wanting to learn C++ recently
@mikeboland-lu8tg
@mikeboland-lu8tg 11 месяцев назад
Aye my man for real tho
@tiagomori2534
@tiagomori2534 Год назад
I would easily watch a 12-hour video lesson on C and C++ from this guy, better than my professors at the university
@jasperlanda5276
@jasperlanda5276 6 месяцев назад
Nice video! As a years-long C++ dev myself I struggled to understand constinit and consteval at first when they came out, until I played around with them. If I may leave some feedback: you mentioned const_cast twice, but without discouraging people from actually using it. It is bad practice to break design/contract and I would always advise against using it as nearly always it's the design or contract that should be rethought. A nice little addition: for constexpr in global/namespace scope it is advised to make them 'static constexpr' in source files and 'inline constexpr' in header files. For example: if you were not to mark a 10'000 byte constexpr array inline, include the header in two source files, compile the two source files and then link them into 1 library, then your compiled data will take up 20'000 bytes as the data was used twice, each per translation unit. Jason Tuner has excellent explanation videos on this.
@myratec5429
@myratec5429 Год назад
Please keep making such great videos. After 6 semesters of computer science I finally found a channel that serves my interests and makes such good videos (that are even animated, I love that kind of thing). I can't stop watching your videos.
@robertdanko7110
@robertdanko7110 Год назад
Cazz gave us another great video. Keep going man, this is nice work. Some advanced animated c++ course would be an amazing thing to do ;) . Good work so far.
@Dulge
@Dulge 2 года назад
really nice explanation, keep the content coming mate
@cazz
@cazz 2 года назад
Thanks Dulge 👌 I appreciate it
@eokauser289
@eokauser289 2 года назад
@@cazz plz make a vid on how to make a cheat loader and a dll
@SameOldjeans
@SameOldjeans Год назад
Can you do a series showing basic too showing alot of keywords. Great videos, easy to understand and enjoyable
@pancakemeow
@pancakemeow 2 года назад
Even tho i knew most of what the video was about, it was really entertaining to watch, great job!
@cazz
@cazz 2 года назад
I appreciate that!
@amrtcpp6203
@amrtcpp6203 2 месяца назад
Thanks for the nice explanation.
@nomadstore4769
@nomadstore4769 2 года назад
Your channel is great, you gained another subscriber. Can you bring some videos about anti cheat? How to make cheats undetectable would be interesting!
@hpeterh
@hpeterh Год назад
const values which are defined as static or global variables are allocated in write protected segments (e.g. in the Code segment) in modern operating systems. If you write to them, you get an exception. This behavior can be modified by compiler switches.
@cazz
@cazz Год назад
So, if you had to const_cast away the constness of a global/static variable and then (attempt to) modify its value you'll receive an exception?
@hpeterh
@hpeterh Год назад
@@cazz I assigned the address of a static const variable to a pointer and then tried to modify it. This gives exception at runtime. In MSVC and in CLANG on Win 10. It gives no exception if the const is a non-static local variable. I believe, static consts are stored in the write protected CODE segment, not in the DATA segment. Try it.
@YTBlue_W
@YTBlue_W 2 года назад
Nice one! Hopefuly there will be more of it ;)
@cazz
@cazz 2 года назад
Absolutely 👌
@xzaker9945
@xzaker9945 2 года назад
Hello, I need help with cheat on WT. I'm a teapot and I can't figure out where the entity offsets are. Can you please tell me exactly where to change the offsets? Or is this cheat no longer relevant?
@leshommesdupilly
@leshommesdupilly 2 месяца назад
Constexpr: I am 4 parallel universes ahead of you
@discordgray2838
@discordgray2838 2 года назад
You forgot, const, uh, nothing! Nice video man, like to see people learning modern cpp features.
@cazz
@cazz 2 года назад
hehe, const all the things!
@DuckForPope
@DuckForPope 10 месяцев назад
3:30 hard coded numbers might be baked into the machine code but they do need to be pushed onto the stack if you pass it as a function argument. They'll end up being stored in a register too depending on the calling convention of the function.
@a5cent
@a5cent 8 месяцев назад
Yeah. He misspoke here. Whether or not an operand is loaded into a register for any given operation depends primarily on the CPU architecture and the operation itself. If an operation requires the data to be in a register, it will be loaded into a register, const or not. I'm not a complier engineer but I'd be surprised if
@pedrofigueiredo7299
@pedrofigueiredo7299 2 года назад
Hi, new subscriber catching up on your videos, what are your thoughts on hardware cheat for faceit, like something simple like just a radar?
@srivallabhavaidya2991
@srivallabhavaidya2991 8 месяцев назад
Can you make c++ videos, your explanations are amazing!
@DevanshDubey-tw1xn
@DevanshDubey-tw1xn 10 месяцев назад
bro which vscode extensions u use for c/c++ can u make video.
@user-cy9qi8kj2g
@user-cy9qi8kj2g Год назад
There are many essentials in the world and cazz is just one of them.
@heitorbarella6125
@heitorbarella6125 2 года назад
You helped me a lot with that video thank you! But I have one question, could you make a video about lambda? Because I hear that it is really useful, but i dont know how it works and how to make a lambda expression. I tried viewing some docs about it, but I didnt understand it 100%. I'll be pleased if you make a video about it
@cazz
@cazz 2 года назад
That is a great suggestion, lambdas are really powerful and I would love to make a video about them! Cheers~
@binnn0502
@binnn0502 Год назад
Can you show me how to program the profile card?
@SwizzEdits_
@SwizzEdits_ Год назад
do you know how to make an unlock all tool for warzone
@user-lg7td1he3s
@user-lg7td1he3s Год назад
i am beginning to think i know nothing about c++ and finally i dont need to hard code the numbers i can go PI = 3.14 rather than typing 3.14 every time because i like making video games which means i have got to squeeze every bit of performance out of c++ i can
@yjc149
@yjc149 8 месяцев назад
i love this video
@celestialentertainment4193
@celestialentertainment4193 2 года назад
Very Good Video; Cazz C++ Series?
@cazz
@cazz 2 года назад
welcome to cazz++ ;)
@captainmeat3
@captainmeat3 2 года назад
ty
@cazz
@cazz 2 года назад
np
@Doomhvh
@Doomhvh 2 года назад
Hey cazz, thank you for your videos. I know this is just a comment on a youtube video but I hope you continue doing the amazing work. Due to your videos I could finally get myself into reversing and C++ after years of myself being lazy and not wanting to learn enough. Thanks again.
@cazz
@cazz 2 года назад
Hey man, thanks for the kind words, I appreciate it more than you know. Keep on going my man, you’ll get there.
@vadiks20032
@vadiks20032 Год назад
how's your learning doing?
@someonesomewhere9020
@someonesomewhere9020 Год назад
Hey cazz, I have a question. What's a better source to learn c++ from, learncpp or The Cherno? Or perhaps a book?
@cazz
@cazz Год назад
I've never read a C++ book, so I can't speak for that but I have used learncpp and The Cherno. Learncpp is a decent place to start, but it should not be your only resource. At least in my experience, I found learncpp quite boring and that's where Cherno's videos came into the rescue. Ultimately though, programming is a practical task and the only way that you are going to get anywhere is by opening up VS and typing out code. Good luck~
@someonesomewhere9020
@someonesomewhere9020 Год назад
@@cazz Appreciate it so much
@jonah1077
@jonah1077 Год назад
This is still confusing for me though... regarding consteval, constexpr, and constinit keywords. If the values of variables/functions with these keywords is known at compiletime, why even use the keywords? Why not just directly substitute the value you *know* it's going to be? Like in the examples, `add(20, 30)` will always return 50 so why not just put 50? I can't think of any actual usecases for these keywords.
@strange1702
@strange1702 2 года назад
good job now i finally understand why you used it in ur game hacking series. btw it would be nice if you made tutorial series on unreal engine game hacking.
@hhbvghj8979
@hhbvghj8979 Год назад
Great I want more
@user-tosjjsusoa
@user-tosjjsusoa 2 года назад
First and thank you for the video!
@Kxcperr
@Kxcperr 2 года назад
This is the most video I’ve watched
@lucid_horizons
@lucid_horizons 2 года назад
this is the most video ever 😂😂😂
@cazz
@cazz 2 года назад
@@lucid_horizons 😇
@dumppleeings4685
@dumppleeings4685 2 года назад
i enjoy every video you make :D makes me smarter everyday !
@cazz
@cazz 2 года назад
Hehe, that's awesome to hear! Thank you :)
@palapapa0201
@palapapa0201 Год назад
2:18 You should have mentioned that if `person` was originally const then this is undefined behavior. 3:11 Top-level const on any non-reference type is redundant.
@tourdesource
@tourdesource Год назад
Modifying the value of a const variable after const_cast is always undefined behavior.
@gigachad8810
@gigachad8810 Год назад
Never used c++ before, is 1:20 a compile-time error or just a warning?
@cazz
@cazz Год назад
Compile-time error
@DeveloperLuka
@DeveloperLuka Год назад
So it seems like it to me that you should use constinit, constexpr and consteval everywhere possible or is there any downside in doing this?
@cazz
@cazz Год назад
In the case of consteval and constinit, you should use them everywhere you can. I say that because those keywords are very strict and there aren't that many use cases in normal programming. Spamming constexpr is different though... In the case of constexpr variables, you should use them everywhere you can. They behave like safer macros. But, the compiler will let you mark a lot of functions as constexpr even though it never uses them as compile-time constants. This could clutter your code and it's unnecessary. I made that mistake a lot in the past. Anyway, good luck!
@DeveloperLuka
@DeveloperLuka Год назад
@@cazz Thank You!
@pozzaza1923
@pozzaza1923 2 года назад
nice explanation, And what about std::move and semantics ?
@cazz
@cazz 2 года назад
brilliant idea!
@ostar-en7ec
@ostar-en7ec Год назад
remember me when you hit one million :D
@cazz
@cazz Год назад
:))
@vprw
@vprw 2 года назад
quality of your content is god tier, i'm learning cpp and always loved hacking in cs, your vids are a lifesaver
@trevormckindsey9064
@trevormckindsey9064 2 года назад
will you be doing a csgo sound esp? or could you? for more legitness
@Silencez
@Silencez Год назад
Cazz, Where did you learn C++?
@0x157
@0x157 2 года назад
fire !
@cazz
@cazz 2 года назад
ice
@LIDL-Penoose
@LIDL-Penoose 2 года назад
good to see not only hacking videos
@cgdonut27
@cgdonut27 2 года назад
Can you show us how to do five m internal
@alirrq
@alirrq Год назад
Hi bro make a video about templates and generics in c++
@ytzzn
@ytzzn 2 года назад
Hey as a beginner I’m not really understanding your YTVIdeo about CS go cheat dev it’s like to advanced for me :( Will u do a video maybe more casual for how to start to learn game hacking ? Not like learn how Cheat engine and C++ work but maybe a video on steps to follow to be a good online games hackers ;) Have a good day.
@DairyMiilk
@DairyMiilk Год назад
Can you make a tutorial on skeleton esp in CSGO
@reinaldofanuel5892
@reinaldofanuel5892 Год назад
Hey, I would like a video about connecting our source code to a game such as GTA V AI of a seld driving car.
@ac8764
@ac8764 Год назад
Funfact: if you do array[-1] you can change the value of a constant you initialized before(C)
@cazz
@cazz Год назад
This is why I love C++ hahaha That’s like a buffer under flow
@vadiks20032
@vadiks20032 Год назад
@@cazz someone should make stackunderflow website where people are wholesome but don't help
@bekonyX26
@bekonyX26 2 года назад
Hi! Can you make a video about implementing CEF in CS:GO? For example the display of youtube in the game
@cazz
@cazz 2 года назад
That's a pretty cool idea. You could do that with the steam overlay and probably Panorama UI too
@bekonyX26
@bekonyX26 2 года назад
@@cazz I'm waiting for lessons from you)))
@aaron6807
@aaron6807 2 года назад
Man after reading some of your source code I can tell you really like constexpr lmao
@cazz
@cazz 2 года назад
Yeah, I’m an ape, I had no clue what constexpr did when I started those :(
@aaron6807
@aaron6807 2 года назад
@@cazz Either way that old code of yours saved me. I would have spent hours trying to find a decent CalcAngle for cs go if it weren't for you. Many thanks you absolute legend
@cazz
@cazz 2 года назад
@@aaron6807 I appreciate it man, glad I helped ;)
@fazin85
@fazin85 2 года назад
Thanks for making me less dumb
@cazz
@cazz 2 года назад
My pleasure good sir
@hagefale_original
@hagefale_original Год назад
Omg thank you please make more videos like that! But Please talk bit slower make this video 10mins because i cant follow you that fast now i need to watch it a second time... Now i understand and hopefully remembered forever.
@cazz
@cazz Год назад
For sure, thank you for the feedback. Upon re-watching months later, you are completely correct!
@Dorka666
@Dorka666 Год назад
hi cazz can you make vids about how to make cheetos undetected (own cheats not public)
@moengai9503
@moengai9503 2 года назад
Dude could you plz explain how most chat spamming works in the game? There is not much information about this.
@cazz
@cazz 2 года назад
In the engine client interface there is a function called “ExecuteClientCMD” or something like that. That function executes console commands and to spam the chat you can execute “say message” and it will print “message” to chat.
@flovnes
@flovnes Год назад
I love cazz++
@cazz
@cazz Год назад
ily, i gotta make more CPP tuts
@hiccubs
@hiccubs 2 года назад
Nice editing
@Vili69420
@Vili69420 Год назад
constinit sounds very British lol
@cazz
@cazz Год назад
I love this comment 😂
@cazz
@cazz Год назад
Bruv
@sajadhemo
@sajadhemo 2 года назад
i watched all your videos and they all awesome Welcome back Sexy Boy
@cazz
@cazz 2 года назад
no u
@xoom7573
@xoom7573 Год назад
Maybe make a video about a custom injector for your cheat so people can inject their cheat in a fancy way. you video's are really good, keep the good work up.
@cynthialucien1926
@cynthialucien1926 5 месяцев назад
so manny memes lol
@salmanulwanzulfan6598
@salmanulwanzulfan6598 Год назад
Bro plzz make an esp for Identity V game android
@0xsandman708
@0xsandman708 2 года назад
C++ is WEIRD (ftfy)
@cazz
@cazz 2 года назад
damn right... ;)
@oksoko7305
@oksoko7305 Год назад
add automatic subtitles to your vids please mate, you're speaking so fast and my native isn't english. Thx
@Vertilix
@Vertilix Год назад
How did u get into game hacking?
@cazz
@cazz Год назад
When I was younger, my first introduction to hacking was jailbreaking which fascinated me. I very much enjoyed gaming too, which lead me to cheating in games. I liked the advantage that cheats gave me. At some point I got curious and wanted to learn how this all worked and a couple years later here we are.
@vijaykankanala3937
@vijaykankanala3937 7 месяцев назад
Your teaching is good but it's like super fast, It's very hard to grasp. :(
@wangyanzhao8475
@wangyanzhao8475 26 дней назад
You shouldn't teach bad practice of C++: 1. `double area(const double radius)` should have a const input parameter. It makes no difference whether it's const or not as the value is always copied from the caller. Adding a const just confuses people who use the function. 2. `constexpr double PI = 3.14f`. There is an unnecessary implicit conversion from float to double here. You should always use auto exactly because of the mistake you made here.
@sigasigasiga
@sigasigasiga Год назад
i think the best way to explain `const` to anyone is to treat them as "read-only", because a variable being read only doesn't mean that it is known at compile time
Далее
TEMPLATES in Modern C++
9:31
Просмотров 27 тыс.
A const int is not a constant.
9:16
Просмотров 67 тыс.
C++ Super Optimization: 1000X Faster
15:33
Просмотров 310 тыс.
31 nooby C++ habits you need to ditch
16:18
Просмотров 757 тыс.
CONST in C++
12:54
Просмотров 399 тыс.
Learn Reverse Engineering (for hacking games)
7:26
PATTERN SCANNING 101 (for game hackers)
6:37
Просмотров 59 тыс.
Return Value Optimization and Copy Elision in C++
9:54
C++ From Scratch: Constexpr
9:45
Просмотров 9 тыс.
how Google writes gorgeous C++
7:40
Просмотров 839 тыс.