There's five mistakes in this code. I found one right off the bat but it seems like the rest wont come to light until I take care of the issue on line 22. It says more than one instance of overloaded function. Its referring to the "add: on line 22
// Overloading.cpp : This code contains five errors before it will work as desired. Find those errors,
// document a description of the errors and their fix, and fix them. Try using the debugger to
// step through the program to find the bugs. As you step through, take notice of the information
// you can see.
//
#include "stdafx.h"
#include
#include
using namespace std;
int add(int, int);
double add(double, double);
int main()
{
int a, b, x;
float c, d, y;
cout << "Enter two integersn";
cin >> a >> b;
x = add(a, c);
cout << "Sum of integers: " << x << endl;
cout << "Enter two doublesn";
cin >> c >> d;
y = add(a, b);
cout << "Sum of doubles: " << y << endl;
return 0;
}
int add(int a, int b)
{
int sum;
sum = a + b;
}
double add(double a, double b)
{
double sum;
sum = a + b;
return sum; //Added semi colon
}