I know that .h file is supposed to have:
- class declarations,
- function prototypes,
- and extern variables (for global variables)
But is there some significance of making it a .h file?
I tried renaming my .h file to a .c file and it still works.
We can name our file to be anything, but we choose to name it as a .h file.
Am I correct?
The use of .h to name header files is just a convention. You will also see (probably on Unix-like platforms):
Personally, I’d strongly advise sticking with .h. Particularly, don’t use .H, or you will be in a world of pain if you ever need to port to case-insensitive file system.