0

Given the following variable declarations and function prototype. How do I write three different calling statement to the MyFunction function without declaring additional variable.

int I; bool B; double D;
double MyFunction (bool, int&);

5
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by Jboy05
0

There's only one way I know of D = MyFunction(B, I); I suppose you could do something like this too, but it seems sort of silly.

D  = Myfunc(false, I);
D = MyFunc(true,I);
0

> How do I write three different calling statement to the MyFunction function
> without declaring additional variable.
what kind of question is this? the second parameter must be I. there are an infinite number of ways in which the first parameter could be a bool.

MyFunction ( B, I ) ;
MyFunction ( I, I ) ;
MyFunction ( D, I ) ;
MyFunction ( D>I, I ) ;
MyFunction ( B && (D==I), I ) ;
MyFunction ( I+I, I ) ;
// ...
0

I think it can be call in diff.. ways as follows:----

1) D = MyFunction(B, I);
2) B= MyFunction(D, I);

3rd Also I dont know
Above two may b correct if wrong then tell how?
:?:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.