here is my code
Code:
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
#define pi 3.14
int main() {
string whatShape;
printf("enter the shape: ");
whatShape = GetLine();
if (whatShape == "box")
{
int width, length, height, ansr;
printf("enter width: ");
width = GetInteger();
printf("enter height: ");
height = GetInteger;
printf("enter length: ");
length = GetInteger;
ansr = height * length * width;
printf("The voulme of the box is: %d ", ansr);
}
if (whatShape == "cube")
{
int side, ansr;
printf("enter the length of a side: ");
side = GetInteger();
ansr = side * side * side;
printf("The volume of the cube is: %d", ansr);
}
if (whatShape == "cylinder")
{
double radius, radiussquared, height, ansr;
printf("enter the height: ");
height = GetInteger();
height = (double)height;
printf("enter the radius: ");
radius = GetInteger();
radiussquared = radius * radius;
radiussquared = (double)radiussquared;
ansr = radiussquared * height * pi;
printf("The volume of the cylinder is: %d", ansr);
}
else printf("that is not a box, cude, or cylinder");
}
error
Code:
: error C2440: '=' : cannot convert from 'int (__cdecl *)(void)' to 'int'
There is no context in which this conversion is possible
i have no idea what to do to fix this, any help would be greatly appreciated