B
Bill Cunningham
I have this code and it will not compile telling me that pow is
undefined. I'm not quite sure what to make of this so I thought I'd get some
feedback.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main (int argc, char *argv[])
{
if (argc != 3)
{
puts ("usage error");
exit (EXIT_FAILURE);
}
double x, y;
x = strtod (argv[1], NULL);
y = strtod (argv[2], NULL);
printf ("%.2f\n", Pow (x, y));
return 0;
}
The code looks fine to me. But there could be something quite apparent
that I'm missing. This while linking to the math library too.
Bill
undefined. I'm not quite sure what to make of this so I thought I'd get some
feedback.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main (int argc, char *argv[])
{
if (argc != 3)
{
puts ("usage error");
exit (EXIT_FAILURE);
}
double x, y;
x = strtod (argv[1], NULL);
y = strtod (argv[2], NULL);
printf ("%.2f\n", Pow (x, y));
return 0;
}
The code looks fine to me. But there could be something quite apparent
that I'm missing. This while linking to the math library too.
Bill