First, move your return statement on Line 40 outside of your for loop. As written, the function returns at the end of the first iteration of the loop instead of at the end of the function.
Second, FindLN() returns an int*, but lnt is a double*. You better double-check what you actually need and adjust one or the other accordingly.
Third, on Line 28, you attempt to call the function foo(). There is no function in your program called "foo".
Fix those, then let us know if you have any other issues.
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
The pointer is a return value. You need a variable of appropriate data type that is local to main() that can be used to catch the return.
int someFunc();
int main() {
int myReturnValue = 0;
cout << "The value of myReturnValue is: " << myReturnValue << endl;
myReturnValue = someFunc();
cout << "The value of myReturnValue is now: " << myReturnValue << endl;
return 0;
}
int someFunc() {
return 1;
}
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
It still is very easy. What I posted was just an example. You have to adapt it to your code... Change the data types, names, AND FUNCTION ARGUMENTS as needed to suit the context.
You already know how to call FindLN() properly. How were you calling it before? The only difference is you're adding an assignment operator as part of the statement.
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393