i am starting programming using CL on IBM system i. My task is to implement RPN calculator using CL language. Typically, this calculator uses stack. But I have no idea have to implement it in CL. Can someone give me some advice? Maybe *PTR variables are solution, but can someone give me an example how to use it?
Thanks in advance JS
edit:
CL language is imposed by my tutor.
My program should receives signs from user (digits/number, signs of mathematical operations).
After receiving each sign program should analize what was received and then take some action, according to pseudo-code:
Do when new sign was entered:
if: entered sign is a number
then push it into stack
else if: entered sign is a sign of mathematical operation
then
- pop two elements from stack
- make operation using this elements and entered sign
- push result into stack
My problem is how to implement or substitude this stack. A need to reach element in LIFO order and I do not know how many elements the structure finally will contain.