Why do we need to include the .h while everything works when including only the .cpp file?
- by reaffer
Why do we need to include both the .h and .cpp files , while we can make it works with making just a .cpp file and then including it .
For example, Creating a file.h containing declarations, then creating a file.cpp containing definitions and including both on the main.cpp.
Or, creating a file.cpp containing declaration/definitions ( no prototypes )
Including it on the main.cpp.
Both worked for me , but still can't the difference since i do not have a background on the compiling and linking process .