   Dev C++ using weird C++ standard?
  Since when was it allowed to include the same header files in the same project several times, and even including header files from header files without getting as much as a warning to boot? O_OMy project required me to do this in Dev C++ for it to even compile. When it did compile though, I didn't get any warning messages at all.#include <cstdlib>#include <iostream>#include "Room.h"using namespace std;int main(int argc, char *argv[]){    Room Room1;    Room Room2;    Room Room3;    int Input;   Room1.RoomDescription = "This is Room 1! \n";    Room2.RoomDescription = "This is Room 2! \n";    Room3.RoomDescription = "This is Room 3! \n";   while(true)    {   std::cout << "What room do you wish to go into? ";   std::cin >> Input;   std::cout << "\n"; switch(Input)   {    case 1:    Room1.DisplayRoom(Room1);    break;    case 2:    Room2.DisplayRoom(Room2);    break;    case 3:    Room3.DisplayRoom(Room3);    break;   }    }  system("PAUSE");    return EXIT_SUCCESS;}#include "Room.h"#include <iostream>void Room::DisplayRoom(Room TmpRoom){std::cout << TmpRoom.RoomDescription;}#include <iostream>class Room{ public:std::string RoomDescription;void DisplayRoom(Room TmpRoom);}; 
  I'm sure nothing is wrong with dev-c++, the same code compiles in visual c++ with no errors. The header files probably have something that checks if everything is already defined, like #ifndef so it doesn't matter if you include the same header file many times.   ;  Short answer: since always. Long answer: including a header twice or including a header in another header is perfectly valid unless nothing is made to avoid redeclaration of symbols. For example, this will work:// -----------------------------------------------// A.h#ifndef A_H#define A_Hclass A{public:  A() { }  ~A() { }};#endif // -----------------------------------------------// A.cpp#include "A.h"#include "A.h"But this will not work (class A is declared twice)// -----------------------------------------------// A.hclass A{public:  A() { }  ~A() { }};// -----------------------------------------------// A.cpp#incldue "A.h"#include "A.h" // error: class type redefinitionI think the Cpp Workshop tutors gave a good explaination of what's going on when you #include a file or when you use any preprocessor directive, so I guess you should read it (I believe it is in the W2 thread).HTH,   ;  Yeah, that's exactly it... Its important if you want to modularize say a big project and small components depend on certain external things.  Even if you already know they will be included, you should at least make a symbolic effort to include them.  Eventually, if they are removed, it won't matter, because the dependencies will be satisfied anyways.   ;  The only file that is being included multipile times is iostream, which has include guards.Imain.cpp and room.cpp( or whatever they are called ) are different translation units and so are compiled seperatly, so the include of "room.h" in one will not affect the include in the other.To see an error, change room.h to this:#incude <iostream>#include "makesAnError.h"class Room{   // the rest the same};add #include "makesAnError.h" to main.cpp.makesAnError.h could look like this:class ErrorBecauseOfRedefinitions{private:    int i;};;  next time: make sure to actually try to understand what you are doing, before blaming tools, languages or standards-otherwise you risk to make a fool of yourself.   ;  OP: You may want to read thishttp://www.gamedev.net/reference/programming/features/orgfiles/;Quote:Original post by Anonymous Posternext time: make sure to actually try to understand what you are doing, before blaming tools, languages or standards-otherwise you risk to make a fool of yourself.Easy on the guy, chief. In case you haven't noticed, this is the "For Beginners" forum, and the official policy is outlined in this thread. Which you obviously didn't read. So, next time, make sure to actually read the rules before you barge in like that.   