0
Is it possible to make a C++ project without our custom header files? suppose i write a class, what about not including ...h?
hearder file so mandatory?
2 Answers
0
It's actually necessary to include a header file when dealing with classes in separate files. A header file contains the constructor's definition which links to the class itself. Without it, the compiler wouldn't know where to find the class if you used it, and would return a compiler error. If you did write the class and the main program itself in the same file, which is impractical by the way if you are using several, that's the only time header files won't be needed.
0
thanks nik1082