0

i was learning about Functions from a book.Keyed in the following code to my visual studio express and got two errors: expect a declaration and '{' : missing function header(old-style formal list.
what do they mean? Does this have to do with ans/isoi std?

#include <iostream>
using namespace std;

void showVolume (int length, int width=1 ,int height=1);

int main()
{
   showVolume(4,6,2);
   showVolume(4,6);
   showVolume(4);

   return (0);
}

void showVolume (int length, int width ,int height);
{ //complier expect a declaration here.
      cout <<"Volume of a box with\n"
           << "Length=" << length << "Width =" << width 
           << "and Height ="<< height
           << "is" << length*width*height;
}
1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Valiantangel
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.