CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    85

    [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.

    1. #include "Complex.h"
    2. #include ".\complex.h"
    3. #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.

  2. #2
    Join Date
    Feb 2000
    Location
    Indore, India
    Posts
    1,046

    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.
    Let me know if I have helped by rating this post

    Recent FAQs

    Drag an image
    Area of a window exposed on desktop
    Display rotated bitmap

  3. #3
    Join Date
    Sep 2007
    Posts
    85

    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?
    Last edited by eranga262154; January 7th, 2008 at 11:06 PM. Reason: incorrect tags

  4. #4
    Join Date
    May 2007
    Posts
    811

    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.

  5. #5
    Join Date
    Sep 2007
    Posts
    85

    Re: Including header files.

    Quote Originally Posted by STLDude
    use the same case as the file itself.
    Yes, I always do it pal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured