C++ Programming Tutorial 96 - Class Across Files - Multifile Compilation
HTML-код
- Опубликовано: 20 мар 2019
- Start your software dev career - calcur.tech/dev-fundamentals 💯 FREE Courses (100+ hours) - calcur.tech/all-in-ones
🐍 Python Course - calcur.tech/python-courses
✅ 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
🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
📈 Buy Bitcoin - calcur.tech/crypto
Reserve the Ruby Steel crypto rewards card and get a $25 bonus (use affiliate code "Caleb") - calcur.tech/crypto Наука
Class across files? I certainly think that you have it, as all of these videos have been superb! Thanks again for making them, and I completely intend to start another tutorial series (possibly Java or Python) immediately once I finish this one...
I know this is a debatable issue, but I have to ask: Is it best to put all #include statements in the header file, or have them in the .cpp files?
In my example, I need includes in both my main and class .cpp files, and I need in my header file. Is it not better to just put all the includes in the header file instead of having them in both my cpp files as well as one in my header file? Maybe this is my C programming habits coming out! Thx...Ian
thank you so much
Thank you so much!!!
the vscode theme looks nice
How about if you have a class that needs to inlcude another class?
I've got an Organizer class that needs to be initiated with an array of Slot's. It doesn't like it when I include Slot from main ("Slot is not a type name") or if I don't ("Expected initializer before allSlots").
You could also use _#pragma__ once_ instead of the #ifndef magic words.
I use xcode. Anyone know how to resolve the following error? "2 duplicate symbols for architecture x86_64"
I have a main.cpp, 2 .cpp + 2 .h files for class declarations & definitions, and 1 .h for enumeration. Any insight is appreciated! Thanks!
Do you generally not use the key word "class" or class name in the .cpp file when you separate it from the declaration .h file? Just definitions and declarations in separate files?
you do not need to use the key word "class" in the .cpp (implementation) file.
still hard to understand why "static" is deleted... can anyone explain about it?
I will try to explain: the variable has already been declared static in the header file so the compiler knows it's a static member. That's why we don't need to specify that it's static again in the user.cpp file.
Hope that clears things up:)
1:42 .h contains the declaration class_name.cpp contains the definition. Thanks
I need help. Are 2 days I'm trying to repeating this exercise, but it doesn't compile. Is the written code available?
I prefer creating a makefile for multiple file compilation. But I have a problem with debugging. It throws an error like "undefined reference" . If I include the implementation file(.cpp) in main.cpp, then the problem goes away. But I want to know if there is another way to fix this. Can you help me ?
please tell me how did you fic this im stuck on it rn too
and this is due today at 11:59 ...
What's your vscode theme?
how to implement templated class sepration ???
I would like to know it too 🤔
69 lines and it's the 96th episode ;)
Nice
nice
niCe
Statistically it happens 1 each 100 episodes, and there you have it.
me coming from java where we can just say "import {class name here}"; and be done...
Me comming from python and having to do more things than c++, while python is supposed to be an easier language
@@mhn2500 you just do import 'filename.oi' or import library
Hehe "big 69 line code" 69 nice
That's very time consuming. python and java is generates these files. I didn't c++ was this bad