|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
--------------------------------------------------------------------------------
I have three functions; one returns a mathmatical operator, the other 2 return the operands. How do I consolidate these 3 variables into yet another function to display the correct result to test against the users response? |
|
#2
|
|||
|
|||
|
double get_result(char* operator, double operand1, double operand2)
{ //define your function here: a switch statement with cases for each operator would be one choice } cout<<get_result( get_operator(), get_operand1(), get_operand2()); Last edited by 7stud : March 4th, 2003 at 01:03 AM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Consolidating function results? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|