hi i have this pieceof code and im not sure as to what it is im doing wrong but i cant get this piece of code rnning any suggestions?

#include <stdio.h>
#include <math.h>

int grade input (double *a[i],double *i)

return 0;

int main (void)
double a[i];
double i;

grade input(&a[i], &i);
printf("How many grades will be curved?\n");

return 0;

Recommended Answers

All 3 Replies

line 4: function names can not contain embedded spaces. Either delete the space or replace it with '_' character.

And the first parameter is coded incorrectly. Looks like all you want is a pointer to a double, not an array of doubles

int grade input (double *a, double *i)

line 6: I don't know what that is but it should be this scanf("%lf", a); line 19: again use "%lf" in the format string.

actually for this code im writing i am looking for an array of doubles because currently i am not finished it but i thought i should work out the early kinks before continuting. the array of double would be for entering numerous grades. i keep getting these error messages

(4)error #2048: Undeclared identifier 'i'.
(4)error #2012: Duplicate declaration for 'i' previously declared at
(6)error #2168: Operands of + have incompatible types 'double * *' and 'double *'.
(6)error #2144: Type error: pointer expected.
(6)error #2144: Type error: pointer expected.
(14)error #2048: Undeclared identifier 'i'.
(15)error #2120: Redeclaration of 'i' previously declared at found 'double' expected 'int'.
(17)error #2168: Operands of + have incompatible types 'double *' and 'double'.
(17)error #2144: Type error: pointer expected.
(17)error #2140: Type error in argument 1 to 'grade'; found 'int' expected 'double * *'.

Many of those errors are self explanatory. Fix those first.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.