Introduction to OOP | Chapter 2: Abstraction : | next | previous | audio | real | text |
int datastack[100]; int datatop = 0; void init() // initialize the stack { datatop = 0; } void push(int val) // push a value on to the stack { if (datatop < 100) datastack [datatop++] = val; } int top() // get the top of the stack { if (datatop > 0) return datastack [datatop - 1]; return 0; } int pop() // pop element from the stack { if (datatop > 0) return datastack [--datatop]; return 0; }Where can you hide the implementation?