Originally Posted by
ee1215
What is the difference in S.Push(12) and Push(S,12)?
The first one can be used if there is a member function of Stack called "Push", the second can be used if there is a regular function (the type you learn about before learning about member functions) which takes a Stack as a parameter as well as the value to push.
i.e. S.Push(12) can be used if something like this is in the code:
Code:
class Stack
{
private
...
public:
...
void Push(int x);
...
}
Push(S, 12) can be used if something like this is in the code:
Code:
void Push(Stack& s, int x)
{
...
}