Ahhh okay..
I renamed it as a ".c" and its running a little smoother i think, but im still coming up with errors :S
Code:
1>c:\users\matthew\desktop\assignment.c(28) : warning C4047: 'function' : 'double *' differs in levels of indirection from 'double **'
1>c:\users\matthew\desktop\assignment.c(28) : warning C4024: 'volume_calc' : different types for formal and actual parameter 1
1>c:\users\matthew\desktop\assignment.c(28) : warning C4047: 'function' : 'double *' differs in levels of indirection from 'double **'
1>c:\users\matthew\desktop\assignment.c(28) : warning C4024: 'volume_calc' : different types for formal and actual parameter 2
1>c:\users\matthew\desktop\assignment.c(28) : warning C4047: 'function' : 'double *' differs in levels of indirection from 'double **'
1>c:\users\matthew\desktop\assignment.c(28) : warning C4024: 'volume_calc' : different types for formal and actual parameter 3
1>c:\users\matthew\desktop\assignment.c(56) : error C2059: syntax error : ')'
Code:
//INCLUDE SECTION
#include <stdio.h> //def's 4 printf, scanf, getchar, puts, gets, fflush
#include <conio.h> //def's for getch
#include <stdlib.h> //def's 4 system
#define PI 3.14159
//FUNCTION PROTOTYPES
void explanation(void);
void volume_calc(double *area, double *radius,double *volume);
void printresults(double area, double radius, double volume);
int main (void)
{
double *area, *radius, *volume;
explanation();//FUNCTION CALL
volume_calc(&area, &radius, &volume);//FUNCTION CALL
printresults(*area, *radius, *volume);
printf("\n\t\t\tPRESS ANY KEY TO EXIT");
_getch();
return 0;
}
//FUNCTION DEFINITIONS
void explanation(void)
{
system ("cls");
puts ("This program will ask you to enter the RADIUS of a sphere...");
puts ("and then calculate the volume and surface area...");
}
void volume_calc( double *area, double *radius, double *volume)
{
//VARIABLE DECLARATIONS
//GET USER INPUT
printf ("\n\n\nPlease entert the radius of the sphere==> ");
scanf ("%f", &radius);
//CALCULATIONS
*volume=((4/3)*PI*(*radius,3));
*area=(4*PI*(*radius,2));
return ();
//OUTPUT
}
void printresults(double area,double radius,double volume)
{
printf("You entered a radius of %.3f...", radius);
printf("\nthe volume of this sphere is ==> %.3f", volume);
printf("\n\ntthe area of this sphere is ==> %.3f", area);
}