#1
  1. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    4
    Rep Power
    0

    Question Consolidating function results?


    --------------------------------------------------------------------------------
    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. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2001
    Posts
    1,473
    Rep Power
    15
    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.

IMN logo majestic logo threadwatch logo seochat tools logo