# Thread: Conflicting functions - Help.

1. ## Conflicting functions - Help.

hello all,
I need help with this code,
the compiler says it has conflicting types of functions (scan_b for example)...
thanks again,
Livnat.

Code:
```#include <stdio.h>
#include <math.h>

void scan_b(double  , int , int );
void print_b(double  , int  , int );
void norm_b(double , int , int );
double std_b(double , int , int );
double avg_b(double , int , int );

int main()
{
int k,l;
double c[100][100];
printf("please enter the number of rows and columns");
scanf("%d%d" , &k, &l);
scan_b(c[100][100] ,k,l);
print_b(c[100][100] ,k,l);
norm_b( c[100][100] ,  k,  l);
printf ("the Standard deviation is: %lf" ,std_b( c[100][100] , k,  l));
printf ("the mean value is: %lf" ,avg_b( c[100][100] ,  k,  l));
return 0;
}

void scan_b(double b[100][100] , int i, int j)
{
int m,n;

for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
scanf("%d" , &(b[m][n]));
}

double avg_b(double b[100][100] , int i, int j)
{
int m,n;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
printf("%d" , &(b[m][n]));
}

void norm_b(double b[100][100] , int i, int j)
{
double sum=0,avg, avg2;
int m,n;

for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n];

avg=sum/(i*j);
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
b[m][n]=b[m][n]-avg;

for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n]*b[m][n];
avg2=sum/(i*j);

for (m=0 ; m<i ; m++)
double std_b(double b[100][100] , int i, int j);        for (n=0 ; n<j ; n++)
b[m][n]=(b[m][n])/sqrt(avg2);
}

int avg_b(double b[100][100] , int i, int j)
{
double sum=0,avg, avg2;
int m,n;

for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n];

avg=sum/(i*j);
return avg;
}

double std_b(double b[100][100] , int i, int j);
{
double avg,avg2,sum,std;
int m,n;
for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n]*b[m][n];

avg2=sum/(i*j);

for (m=0 ; m<i ; m++)
for (n=0 ; n<j ; n++)
sum+=b[m][n];
avg=sum/(i*j);

std=sqrt(avg2-pow(avg,2));
return std;
}```

2. double and double [100][100] are not the same type. Your declaration and definition of scan_b (for example) don't agree. (And you certainly don't want to pass b [100][100] as an argument no matter what.)

3. Double post with a different name in the same section.
What makes you think that's a good idea?

4. I'm guessing a sense of overwhelming entitlement coupled with outright desperation.

5. Thank you
I still have a conflict in the function avg_b
rags_to_riches is totally right

6. Your function definitions and prototypes do not match.

2. scan_b(c[100][100] ,k,l);
To call the function, it's just
scan_b(c ,k,l);

8. >> I'm guessing a sense of overwhelming entitlement coupled with outright desperation.

classic.

9. Originally Posted by Elysia
Double post with a different name in the same section.
What makes you think that's a good idea?
Originally Posted by rags_to_riches
I'm guessing a sense of overwhelming entitlement coupled with outright desperation.
That or he simply tried to change the name after hitting submit; the double post phenomena.