Thread: Using headers and folders in Dev C++

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    3

    Unhappy Using headers and folders in Dev C++

    Hello fellow programmers. I hope you are all having a nice day today.

    Well, my question is about headers in Dev C++.
    In my tutorial class, my lecturer advices students to use header files. Also, in class we use Microsoft Visual C++ and usually when I compile program with header files, it works and gives out outputs.

    At home, I use Dev C++ to practice but I get really confused because I'm not sure which file is being compiled first. I know writing #include "Example.h" in any cpp files will include the desired header files but what if I have multiple cpp files?

    I hope my doubts on headers in Dev C++ is clear enough to be answered. Thank you.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    .cpp files are compiled separately and linked by the linker after they are all compiled. If it matters to you which file is compiled first, then either (1) you're doing it wrong or (2) you're not quite clear on how linking works.

  3. #3
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Quote Originally Posted by Lillers
    In my tutorial class, my lecturer advices students to use header files.
    You mean it is possible for you not to use headers at all?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network headers documentation?
    By hacinn in forum C Programming
    Replies: 4
    Last Post: 07-25-2005, 12:43 PM

Tags for this Thread