Learning C++? Avoid these Beginner Mistakes...

  Рет қаралды 5,486

Caleb Curry

Caleb Curry

Күн бұрын

Start your software dev career - calcur.tech/dev-fundamentals Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
💯 FREE Courses (100+ hours) - calcur.tech/all-in-ones
Timestamps:
00:00 - Intro
00:22 - Ignore Compiler Warnings
01:07 - Assignment in Condition
01:51 - Uninitialized Variables
02:45 - Data Member Initialization
04:08 - Parentheses on Object Creation
05:34 - using new with Object Creation
08:11 - Using Const Wrong
⚛️ FREE React Course (20 hours) - calcur.tech/free-react-course
✅ Data Structures & Algorithms - calcur.tech/dsa-youtube
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
✉️ Newsletter - calcur.tech/newsletter
📸 Instagram - / calebcurry
🐦 Twitter - / calebcurry
🔗 LinkedIn - / calebcurry
▶️ Subscribe - calcur.tech/subscribe
👨🏻‍🎓 Courses - www.codebreakthrough.com
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
↪ My Amazon Store - www.amazon.com/shop/calebcurry
🅿 Patreon - calcur.tech/patreon-calebcurry
🅖 GitHub Sponsors - github.com/sponsors/CalebCurry
Ⓟ Paypal - paypal.me/calcur

Пікірлер: 17
@codebreakthrough
@codebreakthrough Жыл бұрын
What mistakes have you made? Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
@joonyou9392
@joonyou9392 5 ай бұрын
Correct me if I'm wrong but, I think putting an assignment inside an if condition isn't strictly "always" true, but I think it's more that in C++ any non-zero number is considered true, and the assignement operator "returns" the assigned value, thus it depends on the assigned value, if it's 0 it'd be false, otherwise it'd be to if(x = 0) { ‎ //do something } //always evaluates to false if(x = 96) { ‎ //do another thing } //always evaluates to true I know this doesn't change anything but I thought giving out an explanation to this phenomenon would help some people understand why this happens or is allowed
@furkankaraslan9040
@furkankaraslan9040 Жыл бұрын
i got error msg when i was trying to use debugger but weird part is visual studio debugging only works under a certain directory how do i solve that problem any ideas? also since i started to use vsc compiler all exe files my c dev produces getting treatment like it is a virus from my firewall idk why
@Chevifier
@Chevifier 5 ай бұрын
Been learning C++ for the past few months, any reason why you initialized age in the Person Constructor the way you did: Person() : age(0){//constructor stuff }; instead of doing: Person(){ age = 0; }; Its really confusing seeing it done interchangeably.
@BigJMC
@BigJMC 3 ай бұрын
The difference is efficiency, the first example you’re passing a member initializer, basically telling the program to construct the instance with the relevant values. (Basically like giving a blueprint of your house to construction workers and them building it based on that blueprint.) In the second part you’re basically telling program to construct the instance with a default constructor and then assign the relevant values to the variables. So in the second case your program might go and create a instance and set all the values to 0 or some default equivalent and then have to go back and reassign each variable with the relevant values as assigned in the constructor. (So basically telling the constructor workers to build a template house and then after completion telling them to change the rooms and renovate certain part of the house).
@only4posting
@only4posting Жыл бұрын
I've been having a weird issue with visual studio code, (mingw+gcc), with code runner + in tellisense(i think) installed. When i type some little code, i click on debug, it debugs fine, no errors. I then run it, and either the 'output' or 'terminal' will output the correct values. But then, no matter if i add some extra code or not, if i click again on 'debug', i immediately get an error, like 'no file permissions' ! I've checked everything... from install paths... files and folder permissions, etc etc, still the same result. One could think that the file, let's say, test03.exe, could be used, or could exist, somewhere, in the task or process list, and the compiler would simply not be able to overwrite the file... but when i get the error, the file doesn't even exist. Any idea ?
@shiv.shankar
@shiv.shankar Жыл бұрын
Try asking ChatGPT maybe?
@mackinator
@mackinator Жыл бұрын
Any file errors I get have generally been caused by using spaces in the file path. Spaces in any part of the path are a no go usually.
@only4posting
@only4posting Жыл бұрын
@@shiv.shankar done already. It talked about the file already existing in the task bar, and being locked by another process, like explorer.exe... but that wasn't the case. sounds like I'm going to install it on a VM, and mess with it until it works (or explodes :)
@shiv.shankar
@shiv.shankar Жыл бұрын
@@only4posting Ok. I have actually never debugged my code because it creates this json file and all that so i am actually terrified to do it. I will learn to debug after completing DSA
@Nathan00at78Uuiu
@Nathan00at78Uuiu Жыл бұрын
Number one mistake; learning c++. 😂jk jk
@knofi7052
@knofi7052 Жыл бұрын
The biggest mistake is learning C++ in the first place!😂 Just learn C instead!😉
@mimix.v
@mimix.v Жыл бұрын
But what about OOP =)
@nickton
@nickton Жыл бұрын
But C is so bad...
@Shreyas_Jaiswal
@Shreyas_Jaiswal Ай бұрын
​@@nicktonbut it's c++ dad
@PiotrPilinko
@PiotrPilinko 18 күн бұрын
"The more languages you know the more you are human" 😁 For me C is too primitive: c# (or even c++) allows to make a much better and robust code.
Smart Pointers in C++ (Stop Using new?)
17:18
Caleb Curry
Рет қаралды 10 М.
C++ Mistakes Noobs Make (and how to prevent them)
28:22
Colin Galen
Рет қаралды 19 М.
Pray For Palestine 😢🇵🇸|
00:23
Ak Ultra
Рет қаралды 36 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 31 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 150 МЛН
45.Localization With View Content Part 1 شرح بالعربي
13:40
DEADLY C++ Mistakes Beginners Make
10:22
Caleb Curry
Рет қаралды 59 М.
How To Run A Python Program At A Specific Time
5:48
Taylor's Software Solutions
Рет қаралды 910
Rust References and Ownership Complete Introduction
28:45
Caleb Curry
Рет қаралды 2,9 М.
C++ Pointers to Pointers - Finally Understand Double Pointers
13:18
C++ Pointers - Finally Understand Pointers
15:56
Caleb Curry
Рет қаралды 204 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 772 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 720 М.
Making a Game With C++ and SDL2
5:34
Goodgis
Рет қаралды 579 М.
Задача APPLE сделать iPHONE НЕРЕМОНТОПРИГОДНЫМ
0:57
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 77 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 19 МЛН
С ноутбуком придется попрощаться
0:18
Up Your Brains
Рет қаралды 316 М.