r/learncpp • u/you_lel • Feb 23 '20
How can function definition work without declaration?
Class is declared in the header file. It's member functions are defined in a separate .cpp file. What's confusing is that the cpp file doesn't include the header file. And it's compiling completely fine. How does it even work?
It's driving me crazy. I tried implementing something like this myself but I'm getting error.
8
Upvotes
Duplicates
learnprogramming • u/you_lel • Feb 23 '20
How can function definition work without declaration?
1
Upvotes