My problem is that when I enter a value in my C++ program (via cin) it gives me a debug error and says "Run-time Check Failure #3 - the variable 'result' is being used without being initialized." 'result' is an int, and is initialized with a 1, but still gives me this, unlike other peoples' questions.
int multiplication(int x, int y, int result)
{
result = 1;
result = x * y;
return result;
}
int main() //Declares the "main" function, which is mandatory.
{
int result = 0;
char operation;
int x;
int y;
std::cout << "Enter your first number: ";
std::cin >> x;
std::cout << "Enter your second number: ";
std::cin >> y;
std::cout << "Enter your operation (+, -, *, /): ";
std::cin >> operation;
if (operation == '*');
{
int result = multiplication(x, y, result);
}
std::cout << "The answer is: " << result << std::endl;
return 0; //Ends the process with 0x0.
}