RECURSION : Replace all pi

why the code is showing run time error? https://ide.codingblocks.com/s/161683

if the substr(i,i+2) is not equal to pi
than make call for the substr for the substr(i+1)

u are always making call for i+2

e.g
xpix
so according to ur code xp is not equal ot pi
and u r now checking for rest of the string “ix”
so if not equal so make call for the string=“pix”