1 Resposta
0
No, Self in Python doesn’t equate to Stack in cpp.
In Python self is just a naming convention for the first argument of a class method which refers to the object itself that the method is called on. Your could use any name...
You don’t need to provide self in cpp, although ‘this’ is more equivilant, which provides a handle to that instance of a class.
A stack is a container adapter.