B
Bill Cunningham
Is this one of those rare instances where casts are needed? I have this
code and the compiler complains that the prototypes are wrong.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main (int argc, char *argv[])
{
if (argc != 4)
{
puts ("usage error");
exit(EXIT_FAILURE);
}
double x, y;
x = strtod (argv[1], NULL);
y = strtod (argv[2], NULL);
printf ("%.2f\n", pow (argv[1], argv[2]));
return 0;
}
And I did try to link with libm.a
Bill
code and the compiler complains that the prototypes are wrong.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int
main (int argc, char *argv[])
{
if (argc != 4)
{
puts ("usage error");
exit(EXIT_FAILURE);
}
double x, y;
x = strtod (argv[1], NULL);
y = strtod (argv[2], NULL);
printf ("%.2f\n", pow (argv[1], argv[2]));
return 0;
}
And I did try to link with libm.a
Bill