I am trying to pass a string to a function and return the string to the main function.
I keep getting the following error:
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr
I don't know what this means. Can anyone help me?
If I put the same code inside main, the program runs fine. I try to put the code into it's own function and then I get the above error message.