+ 5

What is the meaning of this message in C++ Code Playground?

https://code.sololearn.com/c9O6rFKoxYd0/?ref=app It happened after I made that x as -x

9th Sep 2018, 5:08 PM
Yash✳️
Yash✳️ - avatar
6 Answers
+ 2
it is just the consecuence of an uncaught runtime exception. Try int main() { throw 1; return 0; }
9th Sep 2018, 5:32 PM
Bebida Roja
Bebida Roja - avatar
+ 2
I think the error 'std::out_of_range' seems legit; as fromthe first iteration -x will be -4 it'll be substr(-4). I want to know what the "unusual way" would be. I don't do cpp so I don't know much.. just wanted to make a loop pattern to help someone else
9th Sep 2018, 5:30 PM
Yash✳️
Yash✳️ - avatar
+ 2
Oohk, Bebida Roja. Thanx for clarifying!
9th Sep 2018, 5:34 PM
Yash✳️
Yash✳️ - avatar
+ 1
That seems interesting. I don't understand your code very much, but I think you discovered a bug in sololearn. Maybe you should try to report it to the staff.
9th Sep 2018, 5:22 PM
Jan Štěch
Jan Štěch - avatar
+ 1
happy to help
9th Sep 2018, 5:34 PM
Bebida Roja
Bebida Roja - avatar
+ 1
trying to call substr() with a negative starting index results in a runtime error afaik
10th Sep 2018, 9:18 AM
hinanawi
hinanawi - avatar