0

I have a simple project with the following files, but could not get it to run.

enter image description here

multiplication.h

class Multiplication{
public:
float multiply(float x, float y);
};

subtraction.h

class Subtraction{
public:
float subtract(float x, float y);
};

multiplication.cpp

#include "multiplication.h"

float Multiplication::multiply(float x, float y){
float prod;
prod = x*y;
return prod;
};

subtraction.cpp

#include "subtraction.h"

float Subtraction::subtract(float x, float y){
float diff;
diff = x-y;
return diff;
};

main.cpp

#include "subtraction.h"
#include "multiplication.h"
#include <iostream>

int main(){
//lets calculate 4*5-20
Multiplication* m = new Multiplication();
Subtraction* s = new Subtraction();
std::cout<<s->subtract(m->multiply(4,5),20);
}

However, I get the following errors when I try to build the project and could not figure out why, would love to get some help:)

enter image description here

Kay.Z
  • 43
  • 4
  • You selected the wrong type of project in Visual Studio project wizard. Instead of a Console application you selected some type of GUI application. – drescherjm Nov 05 '21 at 13:22
  • @drescherjm thanks! I changed to console application and it worked. – Kay.Z Nov 05 '21 at 13:32

0 Answers0