#include <iostream> // <iostream>, not <iostream.h>
// conio.h removed (deprecated, nonstandard)
usingnamespace std; // if using namespace std, then say so
void test(double,double,double,double*);
int main() // main must return an int
{
double x=.9;
double y=.95;
double z=1.0;
double ans;
test(x,y,z,&ans);
cout<<ans;
cout << "\nPress Enter to continue\n"; // replaced conio's _getch() with
cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' ); // std solution
return 0; // return an int
}
void test(double x,double y,double z,double *ansptr)
{
if ( x > y || y > z )
*ansptr=.5;
else
*ansptr=-.5;
}
Excellent. Thanks for the help. I am taking an online C++ class and it sucks because the teacher isn't around to answer questions so I am left with bugging you guys. Thanks again for the help and I am sure I will be posing more stuff.
Also, how can I get better search results when I search the forums. I feel like I get ALOT of junk that is of no use. Thanks.