Hi,
I have made a class for stack program on my Dev C++ and I have declared the objects that would be used in the program.
---------------------------------------------------------------------
------------------------------------------------------------------------- ----------------------Code:int main() { Stack stack; // creating a stack object/ //Pushing 5 elements on the stack/ for(int p=0; p<11; p++) { if(!stack.IsFull()) //checking if stack is full or not/ { Line 54 ---> stack.push(p); // push the element on the stack/ } else cout <<"\n Stack is full,can't inset new element"; } //pop the elements at the stack for(int i=0; i<12; i++) { if (!stack.Isempty()) //checks if stack is empty or not/ stack.pop(); } else cout<<"stack is Empty ,can't pop elements"; }
when I try to compile this program ,it gives me an error on the line number 54 as:
54 E:\data\Stack Implementation.cpp no matching function for call to`Stack push(int&)'
--------------------------------------------------------------------
I have declared the variables in the private part of this class
I have shown this line number on the above program.
I wanted to know that what does this error actually means?
Thanks