I am attempting to make an interactive loop that will only break when the user inputs EOF.
When I run the program and it runs the code in main() it spits out the error
error C3861: 'startClass': identifier not found
I've declared startClass in the public class as well as outside the main in its own function so not sure what identifier cannot be found. Thanks.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
class ExchangeList {
private:
double exchRate;
public:
ExchangeList() {
exchRate = 0;
}
void AddExchange(double x) {
if (x > 0) {
exchRate = x;
}
}
double getExchange() {
return exchRate;
}
void startClass(double, double, double, string, string);
};
int main() {
double value{ 0 };
double exchange{ 0 };
double transaction{ 0 };
string toCurr;
string fromCurr;
//ExchangeList N;
while (!cin.eof()) {
cout << "Input exchange rate: ";
cin >> exchange;
startClass(value, exchange, transaction, toCurr, fromCurr);
}
return EXIT_SUCCESS;
}
void startClass(double value, double exchange, double transaction, string toCurr, string fromCurr) {
ExchangeList N;
N.AddExchange(exchange);
cout << N.getExchange();
return;
}