Programming C++ Tutorial (2/50) - Introduction to Include and header files

preview_player
Показать описание
Thanks for watching the video, more videos will soon come that actually explain coding in C++. Please let me know if you have any questions or problems.

This video talked about these subjects:
- C Plus Plus Compiler and preprocessor
- Including header files and other files
- Creating new header file

These videos are currently just introductions to the language and will get you to understand how to begin then we will get more in depth and hopefully one day become experts, at this language, but for now please leave me any questions or suggestions and make sure to like, favorite, and subscribe for new updates as I upload more videos.
Рекомендации по теме
Комментарии
Автор

Thanks for this. Every written guide so far has been about adding libraries through the compiler and linker settings but I could never get it to work. You've unhitched me.

JrIcify
Автор

Yeah one example is if I am making a game and I write a combat system, I can put the combat system in a separate header file to keep it organized and easy to find and edit and continue with the game's mainframe in the rest of the file :)!

MustafaTheGuru
Автор

It actually depends on what kind of file you are going to be creating. An example:
If you are creating something like a game, you'll most likely have many headers to keep everything organized. But if its just a smaller file you are creating, one or two headers is enough. At the end only you can judge which is a better option for you :). Sorry for lack of videos by the way, I am making more and will upload more soon!

MustafaTheGuru
Автор

Yes it will still work, but it will not work until you put some code into it. :) Thanks for the comment, do you want me to create more tutorials?

MustafaTheGuru
Автор

Thanks for the answer and the videos! I am creating a game you could say. So I will put e.g. Sort, Search, Remove, Add, Save and Open functions in separate header files? And only leave the main as a C file?

montanaaa
Автор

I think I just answered my self... Moved the struct into the header file and it's all working now.

But my question now is should I use multiple header files for each of the functions and one for the struct itself or is ONE header file enough?
What is more professional to do?

montanaaa
Автор

I use Struct, where should the struct be in the main or the header?

I am getting errors now since I moved a function to the header file that includes a struct that is in the main file.

montanaaa
Автор

Can I ask you another thing about C? Is it necessary with "malloc" (using the heap instead of stack memory, I think it is) and if so why?
Ty again :)

montanaaa
Автор

When is part 3 coming out??? It's been 3 months!!!

jbird
Автор

I actually wouldn't know, but I did find a nice article about it and sent you it in a private message :) Sorry.

MustafaTheGuru
Автор

why is this narrated by Stephen Hawking

tonydifonzo
welcome to shbcf.ru