I need help to write program which checks if number is between [-21,7; 132,234] in string, using recursion. When i run the code I get exit status -1.(sorry for bad English).
First, change your numeric literals to use a decimal point instead of a comma.
-21,5 becomes -21.5
Second, why does function return an int? What does that integer mean?
Third, a recursion function must have a terminating condition, otherwise it will keep running until you run out of stack space. I suggest you check your i variable against the size of vec. When i becomes too big to be a valid offset into vec, return without doing another recursion.