hi guys.
i hava no idea why the macro is unsafe, i just want the number(x) is always positive. could anyone tell me why, please?
#define number(x) x < 0 ? -x : x
i am looking for the average of these double numbers, but i always got 5.0000, it's the accuracy lost, could anyone tell me what the problem is?
cheers
average (double a[], int n)
{
int i;
double av = 0.0;
for( i = 0; i < n; i++)
{
av += *a++;
}
return av;
}
main()
{
double a[]...
anyone can help me, what does #define eg_H mean in the header file? and what action of preprocessor work on it?
the sections of code can be inserted by #include, but in the output of the preprocessor, does output contain these two /* prog.c */ and # include "eg.h" ?
the code is showing below...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.