Original Post
Bleh. I'm @ school and I'm bored because we're having a test with stupid tasks. So I thought I'd install Dev C++ and have some fun. And I did - but I ran into a problem. ;/ Currently, when the compiler tries to compile, I get no errors, but the compilation process doesn't stop. It just goes on and on and takes 100% of the CPU so I have to shut down the compiler. Here's the source: CPerson.cpp: CPerson.h CWashingMachine.cpp: CWashingMachine.h globals.h: main.cpp:
#include "CPerson.h"
int CPerson::TurnOnWashingMachine(int LaundryProgram, CWashingMachine &WMachine)
{
bool result = WMachine.InitiateWash(LaundryProgram);
if(result = true)
std::cout << "Turned on the washing machine successfully!";
}
#include "globals.h"
class CPerson
{
int LaundryProgram1;
int LaundryProgram2;
int LaundryProgram3;
int TurnOnWashingMachine(int LaundryProgram, CWashingMachine &WMachine);
};
#include "CWashingMachine.h"
bool CWashingMachine::InitiateWash(int Laundryprogram)
{
return true;
}
class CWashingMachine
{
private:
int LaundryProgram1;
int LaundryProgram2;
int LaundryProgram3;
public:
bool InitiateWash(int LaundryProgram);
};
#include "CPerson.h"
#include "CWashingMachine.h"
CPerson Person;
CWashingMachine WashingMachine;
extern CPerson.TurnOnWashingMachine(int LaundryProgram, CWashingMachine &WMachine);
extern CWashingMachine.InitiateWash(int LaundryProgram);
#include <cstdlib>
#include <iostream>
#include "globals.h"
using namespace std;
int main(int argc, char *argv[])
{
Person.TurnOnWashingMachine(1, &WashingMachine);
system("PAUSE");
return EXIT_SUCCESS;
}