Well, I tried this test:
////// include_iostrea m.h START //////////
#include<iostre am>
////// include_iostrea m.h END ////////////
////// including_twice .cpp START //////////
#include<iostre am>
#include "include_iostre am.h"
using namespace std;
int main()
{
cout << "Mainly worked" << endl;
return 0;
}
////// including_twice .cpp END //////////
And it worked with no errors or warnings. When is it the case that
lines that are in .h file cause conflicts with code lines in the .cpp
file that includes it?
////// include_iostrea m.h START //////////
#include<iostre am>
////// include_iostrea m.h END ////////////
////// including_twice .cpp START //////////
#include<iostre am>
#include "include_iostre am.h"
using namespace std;
int main()
{
cout << "Mainly worked" << endl;
return 0;
}
////// including_twice .cpp END //////////
And it worked with no errors or warnings. When is it the case that
lines that are in .h file cause conflicts with code lines in the .cpp
file that includes it?
Comment