#include <iostream>
usingnamespace std;
int AreaCube(int length, int width = 25, int height = 1);
int main() {
int length = 100;
int width = 50;
int height = 2;
int area;
area = AreaCube(length, width, height);
cout << "First area equals: " << area << "\n";
area = AreaCube(length, width);
cout << "Second time are equals: " << area << "\n";
area = AreaCube(length);
cout << "Third time area equals: " << area << "\n";
return 0;
}
AreaCube(int length, int width, int height) {
return (length * width * height);
}
My compiler(g++) say : DefaultParameterValues.cpp:28:43: error: ISO C++ forbids declaration of 'AreaCube' with no type [-fpermissive]
AreaCube(int length, int width, int height) {
Thanks guys! Problem fixed. I guess it's a rookie mistake, but I am new to this and I am in am middle of learning functions so mistakes are expected. :)