C++ Mistakes Noobs Make (and how to prevent them)

  Рет қаралды 19,955

Colin Galen

Colin Galen

Күн бұрын

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

Пікірлер: 48
@ColinGalen
@ColinGalen 2 жыл бұрын
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.
@abhaypatil2000
@abhaypatil2000 2 жыл бұрын
Come to linux. You will love it. Much more reliable that windows
@boundless-sher
@boundless-sher 2 жыл бұрын
@@abhaypatil2000 colin uses mac not windows though
@abhaypatil2000
@abhaypatil2000 2 жыл бұрын
@@boundless-sher which macos has ms paint and notepad++???
@ColinGalen
@ColinGalen 2 жыл бұрын
@@abhaypatil2000 I just switched to mac a couple of videos ago. Most of my past videos were on a windows though.
@subhashsaran4943
@subhashsaran4943 2 жыл бұрын
. ,, , तारक मेहता का उल्टा चश्मा@@abhaypatil2000
@boundless-sher
@boundless-sher 2 жыл бұрын
ah im one of those people who blindedly copy pasted fast i/o without know things i should know about it. thanks colin!
@pranavrajveer3767
@pranavrajveer3767 2 жыл бұрын
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. ✌️
@georgedrooj8800
@georgedrooj8800 2 жыл бұрын
wow man i would love to see more of these and algo lectures
@vaalarivan_p
@vaalarivan_p 2 жыл бұрын
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!!
@TheCarloslucerna
@TheCarloslucerna 2 жыл бұрын
Can you please make a roadmap 😩 you’re soo good at teaching! I want to learn in the way you would recommend it
@Daman1628
@Daman1628 2 жыл бұрын
How i wish,i watched this video 4 months back.It covered everything which i had to manually discover
@kadirdumm8572
@kadirdumm8572 2 жыл бұрын
I made all of these in the past, great video
@mrunankmistry7255
@mrunankmistry7255 2 жыл бұрын
This was really helpful!
@harshvardhan1238
@harshvardhan1238 2 жыл бұрын
"hmm" was epic, nice touch! thanks!
@kj5215
@kj5215 2 жыл бұрын
Very Good, Mr. Galen sir.
@nirajandata
@nirajandata 2 жыл бұрын
thank you mr. galen
@rishikeyyadav5717
@rishikeyyadav5717 2 жыл бұрын
I've been using memset for long time..but didn't knew its working is really cool ..
@originvlcopy
@originvlcopy 2 жыл бұрын
Hey colin, can you please show the compile and run command you use?
@sobieso
@sobieso 2 жыл бұрын
great video !
@nirajandata
@nirajandata 2 жыл бұрын
philosophie
@ahmedcs7156
@ahmedcs7156 2 жыл бұрын
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
@kwanzi.feb2
@kwanzi.feb2 2 жыл бұрын
Thanks a lot !
@akrzha
@akrzha 2 жыл бұрын
Please make some videos related to C++ STL.
@Selim_Hasan_Raj
@Selim_Hasan_Raj 2 жыл бұрын
Could you please tell me How the Eps is working? I tried but I don't understand.
@josephwong2832
@josephwong2832 2 жыл бұрын
informative video
@programinglanguagepascal4248
@programinglanguagepascal4248 2 жыл бұрын
nice video
@abdullasulfikkar5282
@abdullasulfikkar5282 2 жыл бұрын
Can you make a video on how to handle 128 bit integers in c++?
@captainswing4040
@captainswing4040 Жыл бұрын
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😂😂
@rmt3589
@rmt3589 8 ай бұрын
What debuggers do you use?
@captainswing4040
@captainswing4040 8 ай бұрын
@@rmt3589 i use gnu toolkit. so gdb
@abhaypatil2000
@abhaypatil2000 2 жыл бұрын
What is up with those sneak peeks at your face. NGL was quite hilarious
@harshupadhyay4393
@harshupadhyay4393 2 жыл бұрын
Can you share the time stamps?
@abhaypatil2000
@abhaypatil2000 2 жыл бұрын
@@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.
@harshupadhyay4393
@harshupadhyay4393 2 жыл бұрын
@@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?
@abhaypatil2000
@abhaypatil2000 2 жыл бұрын
@@harshupadhyay4393 later on in the video, he randomly shows his face just to convey his reaction on facecam. Really cracked me uo
@harshupadhyay4393
@harshupadhyay4393 2 жыл бұрын
@@abhaypatil2000 ohh,then I defo should watch it
@MiketheCoder
@MiketheCoder 2 жыл бұрын
Hello Galen Colin
@yashchauhan5852
@yashchauhan5852 2 жыл бұрын
This video is a gem. Enough to earn one more subscriber.
@mr.k6831
@mr.k6831 2 жыл бұрын
10:28
@blackswordsman9745
@blackswordsman9745 2 жыл бұрын
16:56 (x+mod)%mod is still -1 on my local run.
@theblinkingbrownie4654
@theblinkingbrownie4654 Жыл бұрын
You forgot to x%mod
@Dhruv-zl8fo
@Dhruv-zl8fo 2 жыл бұрын
__int128
The return of topic streams! (+poll)
3:44
Colin Galen
Рет қаралды 9 М.
Learning C++? Avoid these Beginner Mistakes...
13:47
Caleb Curry
Рет қаралды 6 М.
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 7 МЛН
Её Старший Брат Настоящий Джентельмен ❤️
00:18
Глеб Рандалайнен
Рет қаралды 7 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 27 МЛН
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 376 М.
Exploring LeetCode's WORST Questions
1:14:00
Colin Galen
Рет қаралды 26 М.
Unlocking Your Intuition: How to Solve Hard Problems Easily
17:34
Colin Galen
Рет қаралды 1,2 МЛН
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,3 МЛН
How to Awaken & Enhance Your Analytical Problem-Solving Mind
22:45
Colin Galen
Рет қаралды 145 М.
Faster than Rust and C++: the PERFECT hash table
33:52
strager
Рет қаралды 516 М.
The Dark Side of Competitive Programming
10:49
Colin Galen
Рет қаралды 42 М.
Will Ada Replace C/C++?
44:57
Tsoding
Рет қаралды 83 М.
DEADLY C++ Mistakes Beginners Make
10:22
Caleb Curry
Рет қаралды 59 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 1,2 МЛН
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
КОПИМ НА АЙФОН В ТГК АРСЕНИЙ СЭДГАПП🛒
0:59