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

1st Jun 2020, 10:39 PM
Robin Singh
Robin Singh - avatar
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.
1st Jun 2020, 10:57 PM
Bobby Fischer
Bobby Fischer - avatar
0
Bobby Fischer Thanks I solved it now. here is the version 2. https://code.sololearn.com/c37BtlhKOrGA/?ref=app
1st Jun 2020, 11:21 PM
Robin Singh
Robin Singh - avatar