I am given a task which is as follows: User enters a string of symbols which can be only < (less), > (greater) or = (equal) and string ends with semicolon. The task is to generate numbers between those symbols while the very first number is 1. An example: if user enters <>>>=<; the program should generate numbers according to those symbols, like this: 1<2>1>0>-1=-1<0. In my program everything is working...sort of. Sometimes if I enter 15 symbols, everything works just fine, but when I enter 20 symbols, my program crashes so my guess is I have issues with memory allocation, but not sure where... Any help would be appreciated! Here is my code:
Problem solved!