The function
addition()
should return a value of type
double
that's what this line means:
|
double addition(double first_argument,double second_argument);
|
because you told the compiler that it will return a value, it trusts you will write code which honours that declaration. Placing blind trust in you, it dutifully tries here to output whatever value was returned:
But because there is no return statement in the function, (and I hope the compiler protested and told you so), there is nothing there, so it can only grab at the block of memory where the result should have been located, and output it, as though it was a value of type double.
my compiler gives these messages - don't ignore such messages:
In function 'double addition(double, double)':
[Warning] no return statement in function returning non-void [-Wreturn-type] |
If you don't receive such messages when compiling, try changing the compiler options (MinGW GCC) to;
-std=c++11 -Wall -Wextra -pedantic