How to create a user-defined header file?
is that possible to create a user-defined header file? i mean if i wanna make a user-defined function for addition of two no. s and wants that it should stored in a header file made by me. so is it possible ? if yes then how?
Write your header file which includes your classes, functions, etc. Rename the file to .h extension. In your main.cpp, include the header file. #include "myheader.h" You may also want to look at the preprocessor directives which you may need to include in the header file. https://stackoverflow.com/questions/3246803/why-use-ifndef-class-h-and-define-class-h-in-h-file-but-not-in-cpp