Is there a way to debug a code in sololearn? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there a way to debug a code in sololearn?

as the title suggests - i an currently writing a code but in order to check it and see if it works i can only see compilation error or runtime error is there a way to debug it inside sololearn to search for logical error or do i have to use a launguage specific compiler?

21st Nov 2016, 7:51 PM
Ethan
Ethan - avatar
5 Answers
+ 4
can print every few iterations like every 10th using if condition if(i%10 == 0) cout << something something
21st Nov 2016, 7:59 PM
Burey
Burey - avatar
+ 4
don't sweat it nothing wrong with rewriting the code sometimes it's better to have a fresh start than patching holes all over the place. in the end, it's just more practice which never hurts ;)
21st Nov 2016, 8:08 PM
Burey
Burey - avatar
+ 3
just use cout at critical point print out values addresses whatever helps
21st Nov 2016, 7:53 PM
Burey
Burey - avatar
0
but if i have for example a loop that runs a lot of times it would mean i would print that value a lot of times - even if i add text it can be hard to track sometimes just the end of the loop isnt enough :/
21st Nov 2016, 7:56 PM
Ethan
Ethan - avatar
0
its a good idea in general (so first of all thx for the idea :) ) but i started with a realy not efficient code for my problem to go to a more effective one later on lets just say i have a lot of loops - with recursive included....
21st Nov 2016, 8:04 PM
Ethan
Ethan - avatar