Why am I getting error with this c++ code? -


#include <iostream> using namespace std;  int volume(int l, int w, int h); int main() {     int y, x, z;     cout << "enter length, width , height respectively " << endl;     cin >> y >> x >> z;     volume(y, x, z);     cout << "the volume " << volume();     return 0; }  int volume() {     return l*w*h; } 

i getting 3 errors follows:-

error 'l' not declared in scope.
error 'h' not declared in scope.
error 'w' not declared in scope.

please me rectify error.

your definition of volume doesn't match prototype. needs have 3 parameters l, w, , h defined in function prototype.

int volume (int l, int w, int h){     return l*w*h; } 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -