I am getting an error saying function does not take 2 arugment. Dont know how to fix this. Please help.

#include <iostream>
#include <cmath>
using namespace std;

void set_sides(int,int,int&);

int main()
{
    int Area, Volume;
    cout << "Surface Area and Volume of a Cubic Prism. " << endl
         << "Please enter a length of the Prism "  << endl;
    cin  >> Area;
    set_sides(Area, Volume);
    cout << "\n The volume of a cube is: " << Volume << endl;
    return 0;}
void set_sides(int d,int& vol)
{vol =d*d*d;}

Recommended Answers

All 3 Replies

Look at line 5. Does that match line 13 and 16?

Ok I correct that mistake and the program runs now but it abort after I input an number. Any suggestion?

What do you mean by abort? Does it exit immediately and you don’t see any output or do you get an error? it could be that the program is terminating to quickly. If so after lines 12 and 14 add cin.get() and see what happenes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.