This is my code, and I am getting two errors which is:
error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'double'
error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'double'
Can anyone help??
You haven't given us the line numbers of the lines that are generating the errors.
My guess is that FindMaxByValue and FindMinByValue are the names of functions that you're trying to call. However, you're not calling them, because you're just using the names of those functions without any parentheses.
I put a parentheses at the end to make it a function, but that still doesn't make it work.
My errors are:
error C2440: 'type cast' : cannot convert from 'System::Windows::Forms::DataVisualization::Charting::DataPoint ^' to 'double'
fatal error C1903: unable to recover from previous error(s); stopping compilation
I found the problem. A datapoint needed to be added in. It works perfectly now.
More accurately: you changed the types of maxValue and minValue so that they could store the objects that were returned from FindMaxByValue and FindMinByValue.
The take-home lesson here is: when using a third-party function, look at the documentation to find out how to use it correctly.