Day 6 of 21
My objective: To compile and execute a program which uses my custom "math class" for basic math functions
My problem: I am getting a compiler error (take a look at the exact compile error I have included at the bottom of this thread)
Here is the code of my three files (Main.cpp, MikesMath.h, MikesMath.cpp):
Main.cpp
Code:
#include <iostream>
#include "MikesMath.h"
using namespace std;
int main()
{
cout << "Hello: " << add(2,2) << endl;
system("PAUSE");
return 0;
}
MikesMath.h
Code:
#ifndef MIKESMATH_H_
#define MIKESMATH_H_
class MikesMath
{
public:
MikesMath();
~MikesMath();
int add(int x, int y);
int multiply(int x, int y);
};
#endif
MikesMath.cpp
Code:
#include "MikesMath.h"
int MikesMath::add(int x, int y)
{
return x + y;
}
int MikesMath::multiply(int x, int y)
{
return x * y;
}
MikesMath::MikesMath()
{
}
MikesMath::~MikesMath()
{
}
Here is what my compiler (GCC compiler/Using DevC++) is spitting at me:
Image:
http://img543.imageshack.us/img543/8...pilererror.png