Hey, I'm new to the forum and C++ so thanks in advance for yout help :3
i'm stuck with this programm, because I get a Core dumped error at the end (maybe because I access memory which was not initialized?)
i have to use vectors and recursive functions to write this one. It should read in values and input them in a vector (max. 90 inputs) if the value was already typed in it should ask the user to input the value for this position again until it's a non used value.
The third input.
in main before the while it works.
the first function call that inputs the second value for the vector works (and also checks if it's the same value as the first input)
After the third input I get this error and my programm terminates.
So I guess the error happens in the recursive function line 33
Also the compiler issues a warning, if the condition at line 33 is not true, execution reaches the end of the function without returning a value.
You need to make sure the function will always return a specific value, you could add an arbitrary returntrue; or returnfalse; when you are sure that line will never be reached. But if you do so, then add a message, such as std::cout << "\nthis line should never be reached\n"; just as an alert if something goes wrong.
As well as that, the proper fix is to change line 33 to: