My problem is that even though the function name is typed wrongly the program is still compiling.I am using GNUC.
Here are the 3 files.
The Error is Highlighted.
main.c
Code:
#include <stdio.h>
#include "functions.h"
int main() {
int j, num;
float radius[50], height[50];
scanf("%d", &num);
for( j = 0; j < num; j++) {
scanf("%f%f", &radius[j], &height[j]);
}
for ( j = 0; j < num; j++ ) {
if ( testContainer(radius[j], height[j]) )
printf("Container radius: %f, height: %f\n", radius[j], height[j]);
}
return 0;
}
Code:
#include <stdio.h>
#include "functions.h"
float calculateVolume(float r, float h)
{
return 3.142 * r * r * h;
}
int testContainer(float r, float h)
{
if ( 500 <= calculateVolume(r, h) )
return 1;
return 0;
}
Code:
#ifndef FUNCTION_H #define FUNCTION_H float claculateVolume(float r, float h); int testContainer(float r, float h); #endif
1)What is the Error ?
2) Is it Machine Dependent ?
3)Is it version dependent (e.g turboc,gnuc,etc.) ?
Thanking you.
