incompatible types in assignment

April 26, 2010 at 14:36:59
Specs: Linux x86_64
programming in c

#include <stdio.h> //library

void reading (double lost [][6]);
float average (double [][6]);

int main (void)
{
double lost [4][6];
int xtr = 1;

reading(lost);

do
{

printf("what would u like to do? \n\n 0 to quit \n 1 to average");
scanf("%d", &xtr);

if(xtr == 1)
printf("your average:");
else if (xtr == 2);

}while(xtr != 0);


return 0;
}

void reading (double lost [][6])
{
FILE *work; //pointer
int i = 0, z = 0; //declaring variables
double wow; //initializing

work = fopen("hw.basia","a+");

if(work == NULL)
{
printf("ERROR!");
fclose (work);
}

if(feof(work))
{

for(i = 0; i <= 3; i = i + 1);
printf("\n Please enter student %d's scores: \n", (i +1));
for(z = 0; z <= 5; z = z +1)
{
printf("Please enter test score %d:", (z+1));
scanf("%lf", &wow);
fprintf(work,"%f" , wow);
}


}

return ;

}

float average (double lost [][6])
{
int i = 0;
double sum = 0;

for(i = 0; i < 4; i = i +1);
sum += lost[i]; //this is where it shows incompatible types and i dont't know how to change it so it compiles........................................***
//average calulated above

return sum /= 4;

}


See More: incompatible types in assignment

Report •


#1
April 28, 2010 at 11:12:36
this is PC Gaming, try the Programming Forum.

not a cop out, i just can't help beyond the above suggestion =)


Report •
Related Solutions


Ask Question