C++ Mistakes Noobs Make (and how to prevent them)
Вставка
- Опубліковано 16 чер 2024
- A compilation of various mistakes commonly made in C++ programming, as well as competitive programming in general. I explain what they are, what causes them, and what you can do to try to avoid them in the future.
Stuff I said would be here:
"Excess precision": codeforces.com/blog/entry/78161
More info on sorting comparator ("strict weak ordering"): www.boost.org/sgi/stl/StrictW...
Blog on hashing: codeforces.com/blog/entry/62393
Blog on rand(): codeforces.com/blog/entry/61587
C++ documentation site: en.cppreference.com/
Overview slides: docs.google.com/presentation/...
If I forgot to put anything here, please let me know.
Topics covered:
Intro 00:00
Uninitialized variables 01:31
Index out of bounds 03:04
I/O optimizations (and misusing them) 05:23
Over/underflow 09:34
Handling floats, precision errors 12:47
Handling modulo 15:46
Multiple test cases, global variables 17:00
Shadowing 20:33
Operator precedence 21:21
Mishandling sorting comparators 22:39
Some extra STL/built-in stuff 23:43
General tips & outro 26:07 - Наука та технологія
Very late on schedule. Sorry about that. For some reason, my video editing program decided to go crazy and crash a bunch of times, as well as run at a solid 2 FPS when previewing the video. So... definitely not using that editor again.
Come to linux. You will love it. Much more reliable that windows
@@abhaypatil2000 colin uses mac not windows though
@@boundless-sher which macos has ms paint and notepad++???
@@abhaypatil2000 I just switched to mac a couple of videos ago. Most of my past videos were on a windows though.
. ,, , तारक मेहता का उल्टा चश्मा@@abhaypatil2000
Hey Colin, This video was quite nice and helped me very much figure out many things which i treated as a black box since I was too lazy to read the documentation..
These types of videos do make many unknown thngs meaningful.
It would be nice if you could continue these type of video series.
✌️
wow man i would love to see more of these and algo lectures
ah im one of those people who blindedly copy pasted fast i/o without know things i should know about it. thanks colin!
25:17 . i cant forget that mistake which i did on a contest which costed me more than an hour!! i didnt know that was a mistake till then!! Thanks for the video BTW!!
How i wish,i watched this video 4 months back.It covered everything which i had to manually discover
I made all of these in the past, great video
"hmm" was epic, nice touch! thanks!
This was really helpful!
Very Good, Mr. Galen sir.
thank you mr. galen
Can you please make a roadmap 😩 you’re soo good at teaching! I want to learn in the way you would recommend it
great video !
philosophie
I've been using memset for long time..but didn't knew its working is really cool ..
Thanks a lot !
Hey colin, can you please show the compile and run command you use?
nice video
informative video
can you recommend 1 good youtube video for learning C++ without too much fluff ( just what i need to learn to start competitive programming and learning ds and algos) ?
thanks
Please make some videos related to C++ STL.
What is up with those sneak peeks at your face. NGL was quite hilarious
Can you share the time stamps?
@@harshupadhyay4393 it is thorughout the video. You must watch the video as well. Really really important to avoid uncalled errors. Just watch at 2x speed. It is manageable.
@@abhaypatil2000 well I did watched the first 10 mins or something, by sneak peaks , do you mean FaceCam? I thought if it is some new glitch?
@@harshupadhyay4393 later on in the video, he randomly shows his face just to convey his reaction on facecam. Really cracked me uo
@@abhaypatil2000 ohh,then I defo should watch it
This video is a gem. Enough to earn one more subscriber.
Could you please tell me How the Eps is working? I tried but I don't understand.
Can you make a video on how to handle 128 bit integers in c++?
Hello Galen Colin
Man you are really good at from what i've seen but i've got to say that you don't seem to realize how useful a debigger can be
maybe its because you are so heavily invested in competitive progamming and in those cases i can see your point
But debuggers have allowed me to find all sorts of errors even logical ones
A bit too long i know but i just had to say otherwise i wouldn't be able to look the debugger in the eyes next time i get segfault😂😂
What debuggers do you use?
@@rmt3589 i use gnu toolkit. so gdb
16:56 (x+mod)%mod is still -1 on my local run.
You forgot to x%mod
10:28
__int128