Love your teaching style! I always learn something new when you post a new video!
@NeuralNine3 жыл бұрын
appreciate it :)
@christreedee2 жыл бұрын
@@NeuralNine how does one run one of these .h files thanks :)
@scottblake892 жыл бұрын
I love that you jump right into it... it seems like all the most viewed or liked videos start off with trying to sell something and i cant stand that..
@AnonymousUser-ui4vo10 күн бұрын
then sit dow-
@Guy-bf7wm3 жыл бұрын
Really thank you for these tutorials, I'm starting with competitive programming and I wanted to use c++ and suddenly I saw these videos and they really helped me.
@wangxian79243 жыл бұрын
This video was very clear and amazingly explained. Learnt a lot! Thank you.
@tamirrozenfeld35722 жыл бұрын
Finally i found a video that explain what header is and not make me watch 30 minutes video hoping to hear or get a hint of what header is ! THANK YOU VERY MUCH!
@krakusek8653 жыл бұрын
here I found what I was looking for, a very good video. Thank you bro!
@fatman22173 жыл бұрын
I wasted 3 days looking for a fix on how to include user-made header files, it always caused a linker error in VS Code, can't thank you enough for this video mate :)
@bachirdekdouk54407 ай бұрын
How do you configure this include in the tasks.json file if you dont want to do it from command line ?
@m7md_alj Жыл бұрын
you have no idea how long i spent trying to figure out how to use the header file tysm
@JoaoPedro-nh7uw9 ай бұрын
Thank u so much. I was having problem with a function that was being undefined, and you just saved me😃
@rouisaek Жыл бұрын
The header feels like an Interface. Nice tutorial
@sashokostadinov57733 жыл бұрын
Thank you so much! I am also using the extension and yesterday we started learning about header files and I was wondering what was I doing wrong. I found from internet which file what should it contain but I could not find why it was not compiling.
@ricardocarvalhomiguel26843 жыл бұрын
Thank you very much for the video, I'm from Brazil and only used C ++ in VS2019, and this video helped me to understand how to compile headers files. I will follow more videos from your Channel
@cenkerozkan9906 Жыл бұрын
You explained it very simply and clearly. It couldn't have been explained better. Thanks
@ebiscaia3 жыл бұрын
Hi, is there a way to edit the task.json to include something like "include/*.cpp" to compile everything with F5?
@Aikocake2 жыл бұрын
Any update to this inquire?
@ebiscaia2 жыл бұрын
@@Aikocake Unfortunately not
@DerKommandant Жыл бұрын
@@ebiscaia Have you found a solution yet?
@ebiscaia Жыл бұрын
@@DerKommandant nope, mate. It’s been a while I don’t use C++
@DadicekCz Жыл бұрын
@@ebiscaiabruh, one would say it is one of the most basic things a programmer can do. I'll never stop hating this system
@danieladeba2067 ай бұрын
Wow,Thank you you made me to come out confusion of running c++ with the header files.
@slattsan13152 жыл бұрын
Great tutorials bro, refreshed my c++ quick and good w this series
@mrbout89113 жыл бұрын
In the next videos, you can enlarge the font a little to be clear because I am using the phone and thank you for the effort
@DeepakPandey-dn9iz2 ай бұрын
thank you so much sir. I was facing issues with linking the files.
@janmichaelaustria6203 жыл бұрын
Nice video man! I spent hours trying to find a work around for CMake, and this cleared it up in like 5 mins! You rock!
@33samogo3 жыл бұрын
how did you compilie with g++ -o main.exe main.cpp includes/calculations.cpp commanad?! is not working for me, it works with g++ main.cpp includes/calculations.cpp -o main.exe. What I am missing here? Is there a way to configure Compile Run "F6" command to work with includes?
@ric77023 жыл бұрын
A bad practice but it really works, actually that is the only one that worked for me, I could't made work the one with the header file. I am working with C in VSC. But well at least one way worrked for me. Greetings.
@JianqiuChen2 жыл бұрын
still does not work, it says main.exe is not recognized! vscode and c++ is the hardest config that I have done in my life, 4 hours watching videos cannot get a damn hello world + another class set up. And are you telling me that I have to run the command "g++ -o main.exe main.cpp includes/mynewclass.cpp" every time I create a new class???
@Matdrox2 жыл бұрын
I'm wondering this too...
@sinapiranix2 жыл бұрын
thank you man! youre best teacher for c++
@agentstona2 жыл бұрын
but what if you have 5 different headers that you use for 5 different things at compile do you have to also specify the other 5 different .cpp files ?
@deadeye82 жыл бұрын
Thats where #pragma once Comes into play
@malolan983 жыл бұрын
Keep going! Really great method of teaching!
@sinaghezeljeh22273 жыл бұрын
great video again like every time
@homelikebrick423 жыл бұрын
Why should the files have to have the same name?
@Inoom.4 ай бұрын
They don't have to.
@robromijnders Жыл бұрын
This is really great, thanks for posting!
@123userthatsme Жыл бұрын
Thank you for explaining the h vs cpp thing, i.e. being able to hide the actual functions in cpp. I didn't understand why the boilerplate was duplicated... it was driving me nuts!
@rouisaek Жыл бұрын
the .h file is like a contract to the end user. and they are not duplicated cuz the .h file have the declaration methods and the .cpp file must have the definition of that methods.
@AyaGamal2010 Жыл бұрын
@@rouisaek Good clarification!
@rouisaek Жыл бұрын
Thanks
@danykmk11743 жыл бұрын
believe me !!! You are the best for me !!!!! your method is great
@doc94483 жыл бұрын
Thanks for your instruction! Very easy to understand and informative!
@livedreamsg3 жыл бұрын
So is there any way to get Visual Studio Code to do this for me? I have to jump to the terminal every time, as Visual Studio doesn't recognize it at all. At that point I'm much better off just using Vim.
@NeuralNine3 жыл бұрын
It's always better to use vim
@tamimkhan79192 жыл бұрын
Thanks teacher this video was really helpful for me.
@danielschaad30842 жыл бұрын
what would be the command line in the case I have multiple header files? Do I have to write every single one? or is there a way to compile the whole folder "includes"?
@leonwozniak945610 ай бұрын
i have a same problem, did u find any solution?
@mubarakoyeyinka85203 жыл бұрын
Thanks a lot :) your explanation did help me!. I am trying to use both g++ and cl compiler and I just follow your example using "cl /Zi /EHsc /nologo /Fe:main.exe main.cpp Random1.cpp" in powershell from the working directory. And that's work!
@clarkniyonzima9724 Жыл бұрын
I have a question, what about the #ifndef, #define and #endif in the header file
@ahmedosama68568 ай бұрын
Its a best practice for files validation
@ayushdubey87452 жыл бұрын
How to run a project with a single header file and multiple source files?
@enigma32923 жыл бұрын
Great vid!
@NeuralNine3 жыл бұрын
thanks :)
@hallucinatory.7672 жыл бұрын
Thanks for the tutorial bruh! That's Amazing.
@hyperbhavik2 жыл бұрын
Finally got it, thank you very much
@catorlife Жыл бұрын
for some computers, you can't run the "main.exe" command in the terminal, you need to rewrite it as ".\main"
@Allusioo10 ай бұрын
thanks bro
@rodrigotorres64263 жыл бұрын
Nice video, months to searching this!!
2 жыл бұрын
So, linker identify the implementation of the declaration just by the same filename? What about include guard i learned in C. its not relevant anymore?
@evrolcuk20462 ай бұрын
does "not adding the .cpp file" directly have any importance in terms of privacy? i didn't get that?
@yumyumtales2 жыл бұрын
Great video !!! very well explained
@dakshdesai3 жыл бұрын
Sir can you make a obs studio with python
@inx18193 жыл бұрын
lmfao
@juanjocg18703 жыл бұрын
xddd
@xfire37783 жыл бұрын
What does this even mean?
@larissasouza81693 жыл бұрын
Great video, thank you so much for that!
@ali_youtube_user_73514 ай бұрын
How can I make a header file with its imolementation file that can be included and used across any cpp filed without explicitly including it to your project ? Just like C++ header files (iostream, vector, etc)
@ZAblaze6 күн бұрын
thank you in 2nd class of programming and they taught this in the first one but i didn't pay attention in that lesson lmao
@syldris3 жыл бұрын
Is there any way to run (or execute) the main code(main.cpp) without typing a command such as "g++ -o main.exe main.cpp calculations.cpp"? In Visual Studio (not VS Code), it allows to users to have a class with its header file(.h) and definition file(.cpp) and run it without any single special terminal command, as long as all the files are in the project folder. It seems like VS Code does cannot find the header file's directory on its own.
@luke70493 жыл бұрын
The 'button' you press in Visual Studio is basically an automated implementation of compiling the source code (i.e using the terminal command)
@hodayfa000h Жыл бұрын
BRO just use visual studio it is 100 times better
@hodayfa000h Жыл бұрын
of course as an ide Not a code editior
@syldris Жыл бұрын
@@hodayfa000h Agreed! Already swapped to VS!
@hodayfa000h Жыл бұрын
@@syldris oh yeah this was 1 year ago of course it changed
@Galaktium3 жыл бұрын
Nice vid, very clear, very helpful.
@lucasjoss57333 жыл бұрын
tanks bro, you realy help me to solve the compiler error
@ViktorKatzy8 ай бұрын
The only reason why his C++ code works is that it's afraid of his biceps an getting punched 😹😼 but jokes aside, very good explanation, really helped me out!
@AbhishekYadav-ni5ts2 жыл бұрын
Thank u very much...... This video helped me alot... Thank u 🙏🙏
@TheUruz Жыл бұрын
what if you end up having to compile two files with two implementations of, say, the add function?
@gvega62273 күн бұрын
Are there any alternatives to this? I have tried several times and enterin g++ -o main.exe main.cpp includes/calculations.cpp into the terminal doesn't seem to do anything.
@gvega62273 күн бұрын
specifically, the error is: C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Gabe\AppData\Local\Temp\ccVkqsFx.o:main.cpp:(.text+0x18): undefined reference to `add(int, int)' collect2.exe: error: ld returned 1 exit status
@AyaGamal2010 Жыл бұрын
for this problem in VS code : The term 'g++' is not recognized as the name of a cmdlet, function,.... solution : kzbin.info/www/bejne/a5m2g5SNadiqqtEsi=zzxcLPnKLhjL0cP3
@aashishpanchal30223 жыл бұрын
Thankyou so much sir, really help full.
@DrFerdy2 жыл бұрын
dude,you are using the different version of microsoft visual studio that i use,probably that "most" people use we use the community version
@jersondereal Жыл бұрын
Help🥲 The command isnt working, i keep getting this error, cc1plus.exe: fatal error: main.cpp: No such file or directory compilation terminated.
@AyaGamal2010 Жыл бұрын
for this problem in VS code : The term 'g++' is not recognized as the name of a cmdlet, function,.... solution : kzbin.info/www/bejne/a5m2g5SNadiqqtEsi=zzxcLPnKLhjL0cP3
@vukkulvar9769 Жыл бұрын
Why can't gcc implicitely fetch all the needed files? Why can't you declare what's made visible outside the .cpp file without using a .h file, but by using a "export" keyword for example?
@AyaGamal2010 Жыл бұрын
for this problem in VS code : The term 'g++' is not recognized as the name of a cmdlet, function,.... solution : kzbin.info/www/bejne/a5m2g5SNadiqqtEsi=zzxcLPnKLhjL0cP3
@juanjocg18703 жыл бұрын
love it
@junkdog5053 жыл бұрын
Gracias a tu video encontré la forma de ejecutar los headers no lo encuentro en otros videos se me hace muy pesado el visual studio 2019 ty
@skaterfabi113 жыл бұрын
Thx 4 your videos :)
@Steezylegs_juri Жыл бұрын
really well done thanks
@killzann77573 жыл бұрын
love it bro
@antmoundsock11222 жыл бұрын
i get 3 errors depending on my variables: 'x': identifier not found, 'y' undeclared identifier, and 'z': redefinition, multiple initialization
@BunrithViwatthanak19 күн бұрын
What is the keyboard?
@Rita-og7cy3 жыл бұрын
wait you might have just saved my life
@Rita-og7cy3 жыл бұрын
nope still not working
@lal1th3 жыл бұрын
Okay, so I don't usually comment on videos but this annoyed the hell out of me so I am going to comment if someone else has the same issue If everything works up till the point where he types main.exe and then it just shows you an error message, make sure you are using command prompt as your terminal, or use the equivalent command in your terminal Great video tho! 👍 (edit: just some punctuation)
@naheliegend52222 жыл бұрын
But what if I have 100 of those header files and cpp files? Should I add all of them to the g++ command?
@guigs4467 Жыл бұрын
#pragma once
@Robin-gd8py Жыл бұрын
Thank you so much.
@Jonathan-ru9zl2 жыл бұрын
Hi! How come i have .cpp file that uses stdio.h library and uses printf function?
@saadblabla8 ай бұрын
I still don't get why you would use header files if you can use the cpp instead, you are not hiding your source code using h files the implementation in cpp files shows all the files there.
@randomhuman55393 күн бұрын
You saved me thank you
@byrussx3 жыл бұрын
great video
@NeuralNine3 жыл бұрын
thanks :)
@DepechLyot3 жыл бұрын
Greetings from russia! and thank you for teaching me!
@casperongny8023 жыл бұрын
Hey, what is your intro? BGM
@RenderDragon3 жыл бұрын
You should name your channel as Brainpods
@alexsonic7 Жыл бұрын
bro everybody is asking about several includes, i think that can be achieved with a makefile
@mrentp9 ай бұрын
Isn't this working as interfaces ??
@tips14833 жыл бұрын
Can you livestream you coding some day :)
@NeuralNine3 жыл бұрын
it's on my todo list. sooner or later I will do it :)
@tips14833 жыл бұрын
@@NeuralNine Ok thanks!
@HousseinAlDroubi2 ай бұрын
Good, welcome to you.
@Sakapaka Жыл бұрын
i didnt understand how the calculations.h had access to the calculations.cpp because u didnt inclue the cpp file in the header file
@rouisaek Жыл бұрын
It happens under the hood cuz of the naming conventions. all you need to know is your xxxx.cpp file that have the implementation of the logic must have a xxxx.h file with the exact name that acts like an interface for the users. Now inject the xxxx.h not the xxxx.cpp that must be private.
@costantinoanea6823 жыл бұрын
🤩
@catorlife Жыл бұрын
gosh, why it's so difficult, too many perplexed frameworks you guys just need to switch to VS (purple one) and then you will see it much much easier, just "pragma once" and then everything is on the set
@Hoxolotl Жыл бұрын
so instead of including calculation.cpp you include calculation.h. And the only use for a header file is to make the code more readable by moving the logic back to a second file. Why does it feel like using a sledgehammer on a mosquito? As if back in the days when C was invented "readability" was on the menu. I bet there is a better reason why header files exist. I'll go look it up.
@shahidashadan41043 жыл бұрын
I'm currently using arduino IDE software,but when I'm trying to upload the coding,there are some error and it show a message 'no header files (.h) ' What should i do? Anyone help me please? I really need your help.
@shahidashadan41043 жыл бұрын
And if i not notice someone reply my comment,kindly dm me at instagram. Tq in advance Ig : nrlsy_hda
@joaquins.a.28303 жыл бұрын
In my case it only worked with include "calculations.cpp" or include "calculations.h". with include "includes/calculations.cpp or .h" i got an error.
@ASHISHKUMAR-gh1uu3 жыл бұрын
After creation of main.exe Include your header file in calculation.cpp file i.e #include"calculation.h" And then in main.cpp makes changes of #include "Includes/calculation.h" After that in new terminal Write g++ -o main.exe main.cpp Includes/calculation.cpp Hit enter And then write main.exe It will give result
@dankcherries223 жыл бұрын
@@ASHISHKUMAR-gh1uu He has his calculations.h file in a folder called includes, so "includes/calculations.h" is the path to the calculations.h file. If your calculations.h file is in the same folder as your main.cpp file you only need to have #include "calculations.h"
@thechosenone7465 Жыл бұрын
thanks you❤
@uhhuh593411 ай бұрын
Thanks
@beauMax Жыл бұрын
Classes?
@Rhapsolin7 ай бұрын
for me it wasn't #include "includes/calculations.cpp" it was just #include "calculations.cpp"
@chabaned47434 ай бұрын
thanks
@petermuller1613 жыл бұрын
I read that these function signatures have been called function prototypes. Forgive me I am learning.
@tecfy0282 жыл бұрын
I think this are 2 different names for the same thing