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

Multilayer CSV to filtered excel -

Listboxes in c# -

ios - Why must I define variables twice in the Header file? -