[RESOLVED] Including header files.
Say I have a header file named as "Complex.h"
On .cpp I want to include it. So I test it on following three ways.
- #include "Complex.h"
- #include ".\complex.h"
- #include "complex.h"
In all ways it works fine. So that means there is no any different between above three line?
When I use IDE to add classes to my applications, the header files are included as the second way.
Re: Including header files.
Hello,
First and third has no difference since file name and extensions has no case difference in DOS / Windows. Second indicates that the include directories are set properly in your project.
Regards,
Pravin.
Re: Including header files.
Quote:
Originally Posted by Pravin Kumar
First and third has no difference since file name and extensions has no case difference in DOS / Windows.
That mean header file names are case insensitive.
Quote:
Originally Posted by Pravin Kumar
Second indicates that the include directories are set properly in your project.
Means, first check the working folder and if it is not found search the include directory, is that right?
Re: Including header files.
Quote:
Originally Posted by eranga262154
That mean header file names are case insensitive.
On Windows yet, but Linux no, so to get into good habits, use the same case as the file itself.
Re: Including header files.
Quote:
Originally Posted by STLDude
use the same case as the file itself.
Yes, I always do it pal.