I am trying to pass a structure to my function but I can’t figure it out. I have the code below
struct box
{
char sMaker[40];
float fHeight; //The height of the box
float fWidth; //The width of the box
float fLength; //The length of the box
float fVolume; //The volume of the box
}; //end box
void calcVolume (box *p)
{
p‐>fVolume = p‐>fWidth * p‐>fHeight * p->fLength;
} //end calcVolume
It returns the error that p‐ is an undeclared identifier. I’m really new to c++ why’s it not compiling.
Thank you so much.
Looking at one of your dashes (
-) usingemacs‘sdescribe-char:Replace them all with a minus sign.