I'm brand new to programming..im just trying to make my own program to find the volume and surface area of spheres and cylinders. I cant figure out why this program keeps crashing before it will get to the rest of the code. I'm guessing the char*
might be wrong but i cant see why it would be.
int main()
{
char* solid;
char* unit;
printf("Welcome to the Center of Spheres and Cylinders!\n");
printf("Would you like to look at a Sphere or a Cylinder?: ");
scanf("%s", solid);
if(solid == "Cylinder" || solid == "cylinder")
{
printf("You chose to look at a Cylinder.\n");
else if(solid == "Sphere" || solid == "sphere")
{
printf("You chose to look at a Sphere.\n");
it crashes just after I input for scanf.
..when i type in either cylinder or sphere it crashes. Thank you for the help