0
Do somebody knows why this error?
Well I am getting a segmentation fault error in my little code of finding Youtube Link ID. problem: https://www.sololearn.com/coach/74?ref=app https://code.sololearn.com/cQ6G07OFjl1C/?ref=app
2 Answers
+ 1
1. i should be declared as s.length() - 1
2. try changing your loop condition to while (i > 0) and put your condition inside an if. If the condition is satisfied, break the loop.
0
Bobby Fischer Thanks I solved it now.
here is the version 2.
https://code.sololearn.com/c37BtlhKOrGA/?ref=app